views:

31

answers:

2

Hi All,

I have created a dictionary with a number of different bits of information all pulled from and xml feed. I now want 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 :)

+4  A: 

Try

return [[[sections objectAtIndex: section] objectForKey: @"itemsCount"] intValue];
lukya
A: 

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.

Lou Franco