Help with NSDictionary!
Help with NSDictionary!
- Subject: Help with NSDictionary!
- From: Albert Atkinson <email@hidden>
- Date: Sun, 28 Jul 2002 20:13:56 -0500
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.