quick and dirty NSData implosion
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