2010-08-16 25 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。