Re: how do I check the defaults for an object?
Re: how do I check the defaults for an object?
- Subject: Re: how do I check the defaults for an object?
- From: glenn andreas <email@hidden>
- Date: Sat, 27 May 2006 14:58:16 -0500
On May 27, 2006, at 12:17 PM, Alan Smith wrote:
Hey,
I need to get an array from UserDefaults but the first time this app
is run there won't be that array. That's not the only time either. So,
I need to check to see if that array exists so the app doesn't crash,
the way it does now. I've tried this:
if ([[NSUserDefaults standardUserDefaults] objectForKey:[[otherTable
selectedPilot] name]])
{
//Code creating the array
}
Your code appears to be backwards - the "code creating the array"
will be hit if the object already exists (and if it doesn't exist, it
appears that it may never get created).
Not sure if that's your entire problem - the easiest way is to break
when the exception is thrown and see exactly where in your code some
parent of it came from...
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures,
fractals, art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden