• 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
quick and dirty NSData implosion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quick and dirty NSData implosion


  • Subject: quick and dirty NSData implosion
  • From: Jon <email@hidden>
  • Date: Fri, 08 May 2009 07:25:01 -0600

so far, what i've determined by dumbing this down, is that I must be doing something inherently bad and nubi like here...
the run time just completely implodes when it gets to the "NSData" line of code....
any help would be great, thanks in advance.
the "BookMark" is just a class with the 3 items that you can see below in it, and then uses the @property and @synthesize routines to set the setter and getter, there is nothing else in the class.
I suspect that NSData's keyedArchiver is not expecting a mutable thing? but NSUserDefaults only takes immutable things.


   	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	BookMark *theBookMark = [[BookMark alloc] init];
	NSString *theurl = @"http:/wwww.anything.com/";

NSMutableDictionary *bookMarkList = [[NSMutableDictionary alloc] initWithCapacity: 9];

	bookMarkCount++;

	[theBookMark setBookMarkCount:bookMarkCount];
	[theBookMark setBookMarkurlString:theurl];
	[theBookMark setBookMarkTitle:[docTitle substringToIndex:100]];

NSString *countString = [NSString stringWithFormat:@"%d", bookMarkCount];

	[bookMarkList setObject:theBookMark forKey:countString];

NSData *bookMarkdata = [NSKeyedArchiver archivedDataWithRootObject:bookMarkList];

	[defaults setObject:bookMarkdata forKey:PECBookMarkListKey];

_______________________________________________

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: quick and dirty NSData implosion
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: iPhone how to suppress phone dialer screen
  • Next by Date: Re: quick and dirty NSData implosion
  • Previous by thread: Re: iPhone how to suppress phone dialer screen
  • Next by thread: Re: quick and dirty NSData implosion
  • Index(es):
    • Date
    • Thread