I have some NSMutableArray
of objects which are classes of mine that represent some data structure.
I am trying to save that array of objects to the user defaults, but i can see its not being saved.
I wonder, if the fact the the objects in there are instances of my own classes, and not some pointers to specific images .
//create an object of my class and add to the array
Task *firstTask=[[Task alloc] initWithTag:@"A" AndColor:@"B" AndText:@"C" Done:0];
[self.tasks addObject:firstTask]; //add to array
//save to defaults
[[NSUserDefaults standardUserDefaults]setObject:self.tasks forKey:@"tasks"];
[[NSUserDefaults standardUserDefaults]synchronize];
//retrieve (get null)
self.tasks=[[NSMutableArray alloc] init] ;
self.tasks=[[[NSUserDefaults standardUserDefaults]objectForKey:@"tasks"]mutableCopy];
all the mechanism works, till i am trying to save to defaults .
How do you save these kind of data (objects of my own classes )