开发者

Why do I get a "conflicting type" warning when I implement didSelectRowAtIndexPath:

开发者 https://www.devze.com 2022-12-12 13:33 出处:网络
I\'m implementing the didSelect开发者_如何转开发RowAtIndexPath: method in a tableviecontroller implementation.I get a \"conflicting type\" warning in my code.Everything seems to work, but the warning

I'm implementing the didSelect开发者_如何转开发RowAtIndexPath: 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...


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

0

精彩评论

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