NSKeyedArchiver save method ( that i made) crashed the iphone simulator

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2010-03-16T06:43:32Z Indexed on 2010/03/16 6:46 UTC
Read the original article Hit count: 381

i saw this approach on a tutorial, and the message is working for their example but when i implement this it does not work. from what i can tell the iphone simulator crashes when i do a [ self saveSettingsData]. TheSettings is class object that i declare and initialize in the appdelagate with these methods. the error says terminating due to uncaught exception. i am new to the iphone sdk and objective, so i really can't figure out what is going on thanks to any one who can help, i am ready to literally pull my hair out.

  • (NSString *) SettingsDataFilePath { NSString * settingsDataFilePath ; NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ; NSString * documentsDirectory = [paths objectAtIndex:0] ; settingsDataFilePath = [[documentsDirectory stringByAppendingPathComponent: @"SetggggtingsData.plist" ] retain] ; return settingsDataFilePath ; }

  • (void) saveSettingsData { [NSKeyedArchiver archiveRootObject:[TheSettings copy] toFile:[self SettingsDataFilePath]] ;

© Stack Overflow or respective owner

Related posts about nskeyedarchiver

Related posts about iphone