NSUserDefaults Problem
NSUserDefaults Problem
- Subject: NSUserDefaults Problem
- From: Kyle Mandli <email@hidden>
- Date: Fri, 2 Aug 2002 14:57:59 -0500
I am using the NSUserDefaults system to store preferences for my
application. I set the initial values for the prefs in the +
(void)initialize function in my main controller. One of the keys stores
a integer as a NSNumber (through the function setInteger:forKey:) but
when the program checks to see if that key exists it throws this out to
the console:
warning: stack pointer (0xbffff5f8) is not aligned to a 16-byte boundary.
warning: stack pointer (0xbffff5b8) is not aligned to a 16-byte boundary.
warning: stack pointer (0xbffff1f8) is not aligned to a 16-byte boundary.
warning: stack pointer (0xbffff5f8) is not aligned to a 16-byte boundary.
warning: stack pointer (0xbffff5b8) is not aligned to a 16-byte boundary.
warning: stack pointer (0xbffff1f8) is not aligned to a 16-byte boundary.
and subsequently thinks that the NSNumber is nil and reinitializes the
value. This only happens with 0. Any other integer will not give this
output. I know that this is where the pref is being reset and that
before the application runs the NSNumber is stored properly as a
NSNumber and as 0 through the PropertyListEditor. Any ideas on what
could be causing this? Some code is below. Thanks.
+ (void)initialize
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults integerForKey:@"numViewer"] == nil)
[defaults setInteger:1 forKey:@"numViewer"];
}
Kyle Mandli
**********************************
Mandli Communications, Inc.
email@hidden
**********************************
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.