In a Tabbar app, I have a TableView to show all names of each dictionary of an array coming from an array like this :
<array>
<dict>
<key>Name</key>
<string>Name1</string>
<key>CategoryA</key>
<string>CategoryA1</string>
<key>CategoryB</key>
<string>CategoryB4</string>
<key>CategoryC</key>
<string>CategoryC8</string>
</dict>
<dict>
<key>Name</key>
<string>Name2</string>
<key>CategoryA</key>
<string>CategoryA1</string>
<key>CategoryB</key>
<string>CategoryB1</string>
<key>CategoryB</key>
<string>CategoryB2</string>
</dict></array>
No problem for that. But I would like to have an other tab with a TableView that give first the list of the categoryA. For That I made it like it :
NSString *path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
NSArray* plistData = [NSArray arrayWithContentsOfFile:path];
NSMutableArray* array = [[NSMutableArray alloc] init];
for(NSDictionary* dic in plistData)
{
NSString* contCatA = [dic objectForKey:@"CategoryA"];
if (![array containsObject:contName]) [array addObject:contCatA];
}
self.arrayCategoryA = array;
[array release];
Like this, I obtain a short list with only one of each element of CategoryA.
Here comes my trouble : I would like to go from this tableView to an other that shows only the elements with the key "Name" of the selected categoryA. Nothing I tried do what I expect.
Thx for your help