iphone - Error Handling - NSKeyedUnarchiver -


i using nskeyedarchiver / nskeyedunarchiver send objects on bluetooth ipad iphone remote control. works, shown here.

however, if remote control receives data isn't archived (for example, random nsstring), entire application crashes. want able "if data in archive object x, unarchive , following, ignore otherwise".

is there way handle errors nskeyedunarchiver?

here's code:

- (nsmutabledictionary *)unpackreceivednsmutabledictionaryfromdata:(nsdata *)receiveddata {     nskeyedunarchiver *unarchiver = [[nskeyedunarchiver alloc] initforreadingwithdata:receiveddata];     nsmutabledictionary *receiveddictionary = [[unarchiver decodeobjectforkey:@"mykey"] retain];     [unarchiver finishdecoding];     [unarchiver release];     return receiveddictionary; } 

any suggestions welcome! first time posting on stackoverflow...

okay, figured out after lot of debugging... releasing data earlier caused exc_bad_access. used nszombies track coming , removed data release.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -