eagerterrier
Feb 5, 2009, 04:23 PM
I have a controller that I want to be in charge of getting and setting preferences in the plist files
And I have some code like this
Prefs *prefController = [[Prefs alloc] init];
NSString *cachingOn = [prefController getPreference:@"cachingOn"];
NSLog(@"The preference is *%@*",cachingOn);
if([cachingOn isEqual:@"on"]){
NSLog(@"Caching is on!");
}
Now this works fine. Just great. However, when I have plist nodes that are boolean or date etc, this code just doesn't cut it.
The problem is that my Prefs->getPreference method returns an NSString.
My question is, how do I get the method to return whatever data type the plist node is?
Thanks
TC
And I have some code like this
Prefs *prefController = [[Prefs alloc] init];
NSString *cachingOn = [prefController getPreference:@"cachingOn"];
NSLog(@"The preference is *%@*",cachingOn);
if([cachingOn isEqual:@"on"]){
NSLog(@"Caching is on!");
}
Now this works fine. Just great. However, when I have plist nodes that are boolean or date etc, this code just doesn't cut it.
The problem is that my Prefs->getPreference method returns an NSString.
My question is, how do I get the method to return whatever data type the plist node is?
Thanks
TC
