I am building a plugin, and have saved some strings to userdefaults (from a NSTableView) like so:
which works great.
I would like to reload the strings back into my ArrayController on launching my app. I tried the following function, but It doesnt work?
I also have another question: I would like to update my defaults each time the table is altered. is there an NSNotification I can use to monitor when the NSTableView is altered?
thanks, in advance
Code:
NSArray * myArray = [self myArrayController];
[[MyPreferences userDefaults] setObject: myArray forKey:aKey];
[[MyPreferences userDefaults] synchronize];
which works great.
I would like to reload the strings back into my ArrayController on launching my app. I tried the following function, but It doesnt work?
Code:
- (void) awakeFromNib
{
NSArray * myArray = [[MyPreferences userDefaults] objectForKey:aKey];
[myArrayController setContent:myArray];
}
I also have another question: I would like to update my defaults each time the table is altered. is there an NSNotification I can use to monitor when the NSTableView is altered?
thanks, in advance