iPhone xcode array losing state after load
Posted
by Frames84
on Stack Overflow
See other posts from Stack Overflow
or by Frames84
Published on 2010-04-08T10:47:58Z
Indexed on
2010/04/08
10:53 UTC
Read the original article
Hit count: 196
Right i've had a search around and can't find anything.
@synthesize list; // this is an NSArry
-(void) viewDidLoad {
NSArray *arr = [self getJSONFeed];
self.List = [arr retain]; // if i copy the access code into here it works fine.
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
NSArray *vals = [list objectAtIndex:row] retain];
NSString *id = [vals valueForKey:@"id"]; // ERROR
}
right i've taken some of the code to try and provide it as simple as possible, ignore typo's and memory leaks this is sorted.
Basically when I select a row I can't get data out of my 'list' array object. Please can anyone help me out?
© Stack Overflow or respective owner