I have a NSMutableArray in the didSelectRowAtIndexPath: method:
[self.somethingSelected addObject:[self.arrayFromTable objectAtIndex:indexPath.row]];
The output of this self.somethingSelected (an NSMutableArray) is the following. How do I access just the id value from the following output?
I want self.somethingSelected to store “11,9,21…” and none of the other values like title, etc…
(
{
id = 11;
title = Title0;
},
{
id = 9;
title = Title1;
},
{
id = 21;
title = Title2;
},
)
I tried:
[self.somethingSelected addObject:[self.arrayFromTable objectAtIndex:indexPath.row] objectForKey:@"id"];
but I think I’m mixing up NSDictionary and NSMutableArray, perhaps.
if arrayFromTable holds NSDictionaries than what you tried should work, but you are missing a ‘[‘ & ‘]’. it should be: