sorry guys but i cant get the hang of this array lark. Ive tried everthing to make this work before posting yet another question about arrays. But i cant help it im really stuck
here goes
im simply trying to access a value of a key/value pair :
NSDictionary *itemsInSection = [self.patternImagesArray objectAtIndex:indexPath.section];
NSString *groupTitle = [[[itemsInSection allValues] objectAtIndex:1] objectForKey:@"RequestTitle"];
however when attempting to access the groupTitle it crashes with an invalid pointer "RequestTitle" . Which i can assure you is there.
itemsInSection __NSCFDictionary * 2 key/value pairs 0x00000001555dc410
[0] struct __lldb_autogen_nspair
[1] struct __lldb_autogen_nspair
key __NSCFString * @"RequestTitle" 0x00000001555be430
value __NSCFString * @"Council bill" 0x00000001555db260
The result is fixed and the specific key/value will always appear at position 1 in the dictionary.
I have also tried numerous variations of this line:
NSString *groupTitle = [[[itemsInSection allValues] objectAtIndex:1] objectForKey:@"RequestTitle"];
and
NSString *groupTitle = [[[itemsInSection allValues] objectAtIndex:1] valueForKey:@"RequestTitle"];
and
NSString *groupTitle = [[itemsInSection][1] objectForKey:@"RequestTitle"];
to name just a few.