Create a dictionary property list programmatically

ulquiorra

New member
Jul 14, 2009
1
0
0
Visit site
Hello all ,

I seem to be a little stuck on the creating propertly list issue ( still new to iPhone development).
I want to create a dictionary which feeds data to my uitableview but I seem to be getting some hard luck.
I want to create a dictionary that resembles this one ( give or take a couple of items less )



I've looked at this tutorial at the developer apple website creating property lists is what it is called. Since this is my first post I'm not allowed to post images or links that's why I'm describing it.


and I came up with a small sample of my own

Code:
/keys

NSArray *Childs = [NSArray arrayWithObjects:@"testerbet", nil];

NSArray *Children = [NSArray arrayWithObjects:@"Children", nil];

NSArray *Keys = [NSArray arrayWithObjects:@"Rows", nil];

NSArray *Title = [NSArray arrayWithObjects:@"Title", nil];

//strings

NSString *Titles;

Titles = @"mmm training";

//dictionary 

NSDictionary *item1 = [NSDictionary dictionaryWithObject:Childs, Titles forKey:Children , Title];

NSDictionary *item2 = [NSDictionary dictionaryWithObject:Childs, Titles forKey:Children , Title];

NSDictionary *item3 = [NSDictionary dictionaryWithObject:Childs, Titles forKey:Children , Title];

NSArray *Rows = [NSArray arrayWithObjects: item1, item2, item3, nil];

NSDictionary *Root = [NSDictionary dictionaryWithObject:Rows forKey:Keys];


// NSDictionary *tempDict = [[NSDictionary alloc] //initWithContentsOfFile:DataPath];

NSDictionary *tempDict = [[NSDictionary alloc] initWithDictionary: Root];

it's obvious that i'm trying to use this data of hierachy for my tableviews..
I'm actually using the example from the iphonesdkarticles drill down table view

So I was wondering how can I can create my propertylist( dictionary ) programmatically so that I can fill it with my own arrays.

those of you who read it thnx in advance