UITableViewController: what about warnings about an empty method?

I am working on my first iOS / Cocoa Touch application, and to process user settings I need to create some table views for the navigation controller. Anyway, I created a custom UITableViewController and clicked it on my UINavigationController. I have not changed anything (except return numbers) in the following two methods, but they cause 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 { #warning Incomplete method implementation. // Return the number of rows in the section. return 3; } 
+8
xcode uitableview warnings
source share
1 answer

The #warning directive, which is suitable enough, forces the compiler to issue a warning. Remove these two lines and the warnings should go away.

+20
source share

All Articles