UITableViewController:不完整的方法实现警告是什么?

时间:2011-03-28 02:46:01

标签: xcode warnings uitableview

我正在开发我的第一个iOS / Cocoa Touch应用程序,为了处理用户设置,我需要为导航控制器构建一些表格视图。无论如何,我创建了一个自定义的UITableViewController,并将其推送到我的UINavigationController上。我没有在以下两种方法中改变一个东西(返回数字除外),但它们在XCode中发出警告。是什么给了什么?

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return 3;
}

1 个答案:

答案 0 :(得分:21)

#warning指令足够恰当,导致编译器发出警告。删除这两行,警告就会消失。