objective c - Storing NSMutableArray of UIViews in NSUserDefaults -


i have read several posts i'm not able fix error. if please help.

here code use. have nsmutablearray called list.

-(void) awakefromnib { prefs=[[nsuserdefaults standarduserdefaults]retain];  if ([prefs arrayforkey:@"list"]) {     list=[[nsmutablearray alloc]initwitharray:[prefs objectforkey:@"list"]]; } else {     list=[[nsmutablearray alloc]init]; }     }  -(void)savedata  {    nslog(@"saving data!");   [prefs setobject:list forkey:@"list"];  } - (void)dealloc {  [self savedata]; [prefs synchronize]; [prefs release];   } 

you cannot store uiview instances in user defaults, objects can serialized in property list (see here) also, @justin said, not retain or release defaults object.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -