IPhone Objects from NSDictionary PList?

How about this: NSString *blueColorString = savedData objectForKey:@"2" objectForKey:@"color" The trick is to nest the method calls, the first one savedData objectForKey:2 returns you the inner dictionary object on which you can call the method again. Hope this works as intended Best, Robin.

How about this: NSString *blueColorString = savedData objectForKey:@"2" objectForKey:@"color"; The trick is to nest the method calls, the first one savedData objectForKey:2 returns you the inner dictionary object on which you can call the method again. Hope this works as intended. Best, Robin.

It can be so easy, I didn't think about that - thanks alot :) – scud Jan 16 '10 at 20:39 @Robin: the key must be a string, even if it is the number 2 in the property list file. – benzado Jan 16 '10 at 20:55 @benzado: Hmm, just curious, how would the file be built then if it were an integer? – Robin Jan 16 '10 at 21:09 1 plist format requires keys to be strings.

You can't have an integer key. – Dave DeLong Jan 16 '10 at 22:48 1 As Dave said Property List dictionaries may only have strings as keys. NSDictionary in general may have (almost) any object as a key, though it must be an object.So 2 is no good, but NSNumber numberWithInt:2 would be OK.

– benzado Jan 16 '107 at 6:14.

Typically, you would use valueForKey: when your keys are strings: // to get to "blue" string NSLog(@"outer key '2', inner key 'color' = %@",savedData valueForKey:@"2" valueForKey:@"color"); // all inner key / value pairs for (NSString *key in savedData) { NSDictionary *innerDict = savedData valueForKey:key; for (NSString *innerKey in innerDict) { NSLog(@"key %@ value %@",innerKey,innerDict valueForKey:innerKey); } }.

Thank you as well – scud Jan 16 '10 at 20:47.

That's even more elegant than the previous answers, thank you – scud Jan 17 '10 at 16:42.

Plist file specifies a main nib file to be loaded, by including the NSMainNibFile key and a valid nib file name for the value, this function loads that nib file. Despite the declared return type, this function never returns. For more information on how this function behaves, see ““Core App Objects”” in iOS App Programming Guide.

AvailabilityAvailable in iOS 2.0 and later. ParametersorientationSpecify the value of the orientation property of the UIDevice class.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions