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

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

jQuery Ajax Render Fragments OR Whole Page -

java - Why is BlockingQueue.take() not releasing the thread? -