0

I'm implementing the didSelectRowAtIndexPath: method in a tableviecontroller implementation. I get a "conflicting type" warning in my code. Everything seems to work, but the warning bugs me. The code in my implementation file is as follows.

- (void *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {

Originally I had a return type of (NSIndexPath *), but found the type should be void as stated in UITableView.h. Both return types have the same effect. The code works, but I get the following warning...

warning: conflicting types for '-(void)tableview:(UITableView *)tableView...

Thank you for any help you can give...

Ben S
  • 68,394
  • 30
  • 171
  • 212
Michael
  • 1,009
  • 1
  • 9
  • 12

1 Answers1

10

Your return type should be void, not void *, as stated in the UITableViewDelegate documentation.

Matt Ball
  • 6,608
  • 1
  • 32
  • 31
  • This man is correct. Also, when writing SDK delegate methods like those in table view handling I find it's always best to open the documentation and directly copy the declaration from there so they don't get messed up. – Alex Wayne Nov 24 '09 at 02:11