可以从tableView返回NSUInteger:numberOfRowsInSection吗?

时间:2011-07-26 15:47:15

标签: ios uitableview casting

我正在开发一个简单的Table View iOS应用程序,我想在NSMutableDictionary中为每个条目显示一个单元格。这是我目前使用的代码:

   - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
    // Return the number of rows in the section.
    return [myDict count];
}

据我所知,NSMutableDictionary的count方法返回一个NSUInteger。使用上面的代码是否需要注意哪些问题?

1 个答案:

答案 0 :(得分:2)

不会出现任何问题,因为count总是0或更大的数字,它可以返回无符号整数。

相关问题