Re: Help with NSDictionary!
Re: Help with NSDictionary!
- Subject: Re: Help with NSDictionary!
- From: Nico <email@hidden>
- Date: Mon, 29 Jul 2002 09:17:49 +0200
You whould try to use NSUSerDefaults and -boolForKey:/-setBool:forKey:
methods.
Nico
On 7/29/02 3:13 AM, "Albert Atkinson" <email@hidden> wrote:
>
Hello!
>
>
I need some help with an NSDictionary...what I am trying to do is
>
test to see if a certain key and value are listed in my
>
NSDictionary...here is how I have written the code:
>
>
NSDictionary *prefs;
>
>
prefs = [NSDictionary dictionaryWithContentsOfFile:
>
[@"~/Library/Preferences/AlwaysUP Preferences.plist"
>
stringByExpandingTildeInPath]];
>
checkRunning = [NSTimer scheduledTimerWithTimeInterval:5
>
target:self selector:@selector(launchServer:) userInfo:nil
>
repeats:YES];
>
ON = [NSImage imageNamed: @"On.tif"];
>
OFF = [NSImage imageNamed: @"Off.tif"];
>
>
if (prefs) {
>
if ([prefs objectForKey:@"FirstLaunch"]==@"YES") {
>
//This is the apps first launch...code snipped
>
} else {
>
//The is not the apps first launch...code snipped
>
}
>
}
>
>
However for some reason it always says the app has not been
>
launched even though in my PLIST file it has:
>
>
<?xml version="1.0" encoding="UTF-8"?>
>
<!DOCTYPE plist SYSTEM
>
"file://localhost/System/Library/DTDs/PropertyList.dtd">
>
<plist version="0.9">
>
<dict>
>
<key>FirstLaunch</key>
>
<string>YES</string>
>
</dict>
>
</plist>
>
>
Any suggestions?
>
>
Albert
_______________________________________________
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.