I have created a dictionary with a number of different bits of information all pulled from and xml feed. I now wan开发者_JAVA百科t to pull certain parts from the dictionary into areas to create my tableview.
so far creating the section headers was fine, but having a problem with the numberofrowsinsection part:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [[sections objectAtIndex: section] objectForKey: @"itemsCount"];
}
This gives the following error: warning: return makes integer from pointer without a cast Any help welcome on this very much newbie :)
Try
return [[[sections objectAtIndex: section] objectForKey: @"itemsCount"] intValue];
objectForKey returns id -- which is not automatically convertible to NSInteger. You need to cast this to the object type that you put in the dictionary and then convert that to NSInteger.
精彩评论