开发者

UITableViewController: what's with the incomplete method implementation warnings?

开发者 https://www.devze.com 2023-02-19 23:18 出处:网络
I\'m working on my first iOS/Cocoa Touch app, and to handle user settings, I need to build a few table views for a navigation controller. At any rate, I created a custom UITableViewController, and pus

I'm working on my first iOS/Cocoa Touch app, and to handle user settings, I need to build a few table views for a navigation controller. At any rate, I created a custom UITableViewController, and pushed it on my UINavigationController. I didn't change a thing (except the return numbers) in the following two methods, but they kick out warnings in XCode. What gives?

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

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


The #warning directive, appropriately enough, causes the compiler to emit a warning. Delete those two lines and the warnings should go away.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号