views:

237

answers:

1

Hello,

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...

+7  A: 

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

Matt Ball
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.
Squeegy
Thank you! I will be more careful to copy the declaration next time...
Michael