Re: hanging on NSUserDefaults setValue:forKey
Re: hanging on NSUserDefaults setValue:forKey
- Subject: Re: hanging on NSUserDefaults setValue:forKey
- From: John Stiles <email@hidden>
- Date: Mon, 2 Aug 2004 10:31:08 -0700
You should try getting a Shark or Sampler report when it's hung. It
might not be immediately useful info for you, but an Apple engineer
could probably make sense of it right away, and it's possible that it
might give you a clue as well.
On Aug 1, 2004, at 9:20 PM, Mark A. Stratman wrote:
>
My application seems to sporadically hang on the following call to
>
setValues:forKey, where 'date' is an NSDate
>
>
if (date != nil) {
>
[[NSUserDefaults standardUserDefaults] setValue:date
>
forKey:@"dateLastChecked"];
>
}
>
>
I wish I could narrow it down and give more details, but I'm
>
completely stumped. I can't seem to figure out an exact way to
>
recreate this. To get it to occur most often, I delete its
>
~/Library/Preferences/blah.blah.plist.
>
>
Does anyone know offhand what might be a cause of this?
>
>
If it's of any use, the defaults are set up with the following, where
>
'defaults' is an NSDictionary:
>
[[NSUserDefaultsController sharedUserDefaultsController]
>
setInitialValues:defaults];
>
if ([[NSUserDefaults standardUserDefaults] persistentDomainForName:
>
[[NSBundle bundleForClass:[self class]] bundleIdentifier]])
>
{
>
[[NSUserDefaults standardUserDefaults]
registerDefaults:defaults];
>
} else {
>
[[NSUserDefaults standardUserDefaults]
registerDefaults:defaults];
>
[[NSUserDefaults standardUserDefaults]
setPersistentDomain:defaults
>
forName:[[NSBundle bundleForClass:[self class]]
bundleIdentifier]];
>
}
>
[[NSUserDefaults standardUserDefaults] synchronize];
>
>
- mark
>
_______________________________________________
>
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.
_______________________________________________
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.