IOS开发代码:
listOfItems NSMutableArray
声明:
@interface SAMasterViewController () {
NSMutableArray *listOfItems;
}
@end
现在,有一部分代码报出错误:EXC_BAD_ACCESS (code=1, address=0x5fc260000)
,出在最后一行individual_data
对象中。
listOfItems = [[NSMutableArray alloc] init];
for(NSDictionary *tweetDict in statuses) {
NSString *text = [tweetDict objectForKey:@"text"];
NSString *screenName = [[tweetDict objectForKey:@"user"] objectForKey:@"screen_name"];
NSString *img_url = [[tweetDict objectForKey:@"user"] objectForKey:@"profile_image_url"];
NSInteger unique_id = [[tweetDict objectForKey:@"id"] intValue];
NSInteger user_id = [[[tweetDict objectForKey:@"user"] objectForKey:@"id"] intValue ];
NSMutableDictionary *individual_data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
text, @"text_tweet",
screenName,@"user_name",
img_url, @"img_url",
unique_id, @"unique_id",
user_id, @"user_id", nil];
[listOfItems addObject:individual_data];
}
你可以参考一下这个帖子的解决办法:
http://www.cocoachina.com/bbs/read.php?tid=100505