Can you help me how to create NSDictionary format of the following structure.
Children = (
{
Children = (
{
Children = (
{
Children = (
Monty,
Smithers,
Frink,
Carl,
Cletus,
Bobo,
Duff
);
Name = Simpsons;
},
{
Children = (
"Mountain Unicycling",
"Rock Climbing",
Bouldering,
Snowboarding
);
Name = Sports;
},
{
Children = (
"Eating Strawberries",
Mangoes,
Treehouses,
"Good Weather",
Maui,
Trogdor
);
Name = "Just Fun Stuff";
},
"Foo with the Bar",
Bar,
BooFar,
"Foo Bar"
);
Name = Shows;
},
{
Children = (
{
Children = (
"Big Sur",
"New York",
Naples,
"Chez Panisse",
Lucia,
Switzerland,
Ireland
);
Name = Vacation;
},
{
Children = (
"Green Bay",
Milwaukee,
Monroe
);
Name = Other;
}
);
Name = Travel;
},
{
Children = (
Kark,
Valen,
Kosh,
"Red Letter",
"Fluffy Ears",
Hiro
);
Name = "Science Fiction";
}
);
Name = "Favorite Things Group";
},
{
Children = (
Mischief,
Mayhem,
Soap
);
Name = "Movies Group with a Long Title";
},
{
Children = (
ObjC,
Cocoa,
KVC,
NSTooblar
);
Name = "Things That Rule";
},
{
Name = Eagle;
}
);
Name = OVRoot;
}
I have to tried many ways. Still i struggle with the NSDictionary code. This is my code is following.
NSArray *desk = [NSArray arrayWithObjects:@"Desktop",@"Mac App",@"IOS App"];
NSMutableDictionary *secondtype = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Desktop",@"Name",
[NSMutableArray arrayWithArray:desk],@"Children",nil];
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"OVRoot",@"Name",
[NSMutableArray arrayWithObjects:secondtype,
nil], @"Children",nil];
Could you pls help me to how to create this hierarchy as dynamically. In my project scope is display the Desktop, document all folder name in tree format.