8
我正在开发我的第一个iOS/Cocoa Touch应用程序,并且为了处理用户设置,我需要为导航控制器构建几个表格视图。无论如何,我创建了一个自定义的UITableViewController,并将其推送到我的UINavigationController上。在以下两种方法中,我没有改变一个东西(除了返回数字),但是它们在XCode中发出了警告。是什么赋予了?UITableViewController:不完整的方法实现警告有什么用?
- (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;
}
有趣。为什么他们在那里呢?苹果公司指出你需要改变返回值吗? – Gregir 2011-03-28 03:05:58
@Gregir:这可能正是它的目的。 – Anomie 2011-03-28 03:18:40
感谢您的快速回答。无法相信我迄今为止在所有阅读中都错过了#warning指令的概念。 – Gregir 2011-03-28 03:20:54