• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bad stardardUserDeafaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Bad stardardUserDeafaults
      • From: Jens Alfke <email@hidden>
References: 
 >Bad stardardUserDeafaults (From: Jacob Schwartz <email@hidden>)
 >Re: Bad stardardUserDeafaults (From: "I. Savant" <email@hidden>)
 >Re: Bad stardardUserDeafaults (From: Jacob Schwartz <email@hidden>)
 >Re: Bad stardardUserDeafaults (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop
  • Next by Date: Re: CoreAnimation: image is too large
  • Previous by thread: Re: Bad stardardUserDeafaults
  • Next by thread: Re: Bad stardardUserDeafaults
  • Index(es):
    • Date
    • Thread