2010-08-16 44 views
0

我已经创建了一个字典,其中包含一些不同的信息位,这些信息都来自xml feed。我现在想把字典中的某些部分拖入区域来创建我的tableview。问题numberOfRowsInSection和字典

到目前为止创建节标题被罚款,但具有与该numberofrowsinsection部分问题:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
    return [[sections objectAtIndex: section] objectForKey: @"itemsCount"]; 
} 

这提供了以下错误:警告:返回时将指针整数,未作铸 任何帮助欢迎这非常新手:)

回答

4

尝试

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

objectForKey返回ID - 这是不是自动CON可转换为NSInteger。您需要将其转换为放入字典中的对象类型,然后将其转换为NSInteger。