good day. i need some help with reading from a plist. i am an objective-c noob and would appreciate any help and code examples. i don't believe i am far off.
i have a root.plist with two text field items.
my code to read from the list:
-(void)readConfigurationItemsFromSettingsBundle{
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
NSLog(@"Could not find Settings.bundle");
return;
}
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
for (NSString *str in preferences)
NSLog(@"--%@", str);
}
Select all Open in new window
here are my results:
--{
Key = "server_ip";
Title = "server ip address";
Type = PSTextFieldSpecifier;
}
--{
Key = "audio_number";
Title = "audio notification #";
Type = PSTextFieldSpecifier;
}
i'm looking for the actual values within each key, but i don't know how to go about it....
thank you.