Re: Bad stardardUserDeafaults
Re: Bad stardardUserDeafaults
- Subject: Re: Bad stardardUserDeafaults
- From: Jacob Schwartz <email@hidden>
- Date: Thu, 1 Oct 2009 17:19:23 -0400
I meant like if it was a common case. Nevermind though, here is the
code:
Archiving:
NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"/
Users/jacobschwartz/Pictures/wallpapers"]];
NSData *pathAsData = [NSKeyedArchiver archivedDataWithRootObject:url];
[defaultValues setObject:pathAsData forKey:JHSPathKey];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
Unarchiving:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *pathAsData = [defaults objectForKey:JHSPathKey];
return [NSKeyedUnarchiver unarchiveObjectWithData:pathAsData];
And then I call:
[textField setStringValue:[[self pathName] absoluteString]]
(pathName is the unarchiving method)
And gdb gives me this error:
2009-10-01 17:18:25.391 SyncBackground[452:a0f] -[NSButton
absoluteString]: unrecognized selector sent to instance 0x10013a7b0
Thank you again.
-Jake
On Oct 1, 2009, at 3:51 PM, I. Savant wrote:
On Oct 1, 2009, at 3:49 PM, Jacob Schwartz wrote:
I didn't post it right away in case this was a common mistake
That's the problem. If you think about it, how can we know what
kind of mistake it was without seeing what you actually did? :-)
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden