Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BollywooD

macrumors 6502
Original poster
I am wanting to create an NSArray from strings stored (at various levels) in a plist of nested NSDictionary's.

I am trying the following code, but it only reads the key from the root dictionary: (FolderPath, and PlistFullName, have been previously defined)

Code:
NSString *plistFolder = [FolderPath stringByExpandingTildeInPath];
	NSString *PlistPath = [plistFolder stringByAppendingPathComponent:PlistFullName];
	
	NSDictionary *myDictionary = [NSDictionary dictionaryWithContentsOfFile: PlistPath];
	NSArray *myArray = [myDictionary objectForKey:@"myKey"];

where do I begin?
 
I am wanting to create an NSArray from strings stored (at various levels) in a plist of nested NSDictionary's.

I am trying the following code, but it only reads the key from the root dictionary: (FolderPath, and PlistFullName, have been previously defined)

Code:
NSString *plistFolder = [FolderPath stringByExpandingTildeInPath];
	NSString *PlistPath = [plistFolder stringByAppendingPathComponent:PlistFullName];
	
	NSDictionary *myDictionary = [NSDictionary dictionaryWithContentsOfFile: PlistPath];
	NSArray *myArray = [myDictionary objectForKey:@"myKey"];

where do I begin?

First step: Forget for a second that you want an NSArray containing objects in a dictionary, just think about creating an NSArray containing various objects. How do you do that?

Next step: How do you get various objects from an NSDictionary, stored in different places?

Third step: Put one and two together.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.