Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Self-Destructing Message iPhone App Relating Users in Parse.com Adding Friends by Tapping on a Table View Cell

EditFriendsViewController.m file

Hello,

In my EditFriendsViewController.m file the didSelectRowAtIndexPath method was not there by default. I added it in but when I type in "UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath];", I receive the error "No visible @interface for 'UITableViewCell' declares the selector 'cellForRowAtIndexPath:'

Much appreciated

4 Answers

Stone Preston
Stone Preston
42,016 Points

this could be the issue:

UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath];

should be

UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];

Thanks for the reply. But I'm more concerned as to why the method wasn't there by default in the first place. Is this a xCode 4 update? Have the TableViewControllers changed their default methods?

Thanks for the reply. But I'm more concerned as to why the method wasn't there by default in the first place. Is this a xCode 4 update? Have the TableViewControllers changed their default methods?

Stone Preston
Stone Preston
42,016 Points

Its not really a cause for concern. For some reason in Xcode 5 this delegate method just isnt automagically implemented for you like it was in previous versions, so you have to implement it your self. There are a lot of times when you have to do this. Xcode doesnt always add everything you need automatically for you, in the case of tableViewControllers it adds most of what you need, but some things are left up to you to implement.

Thanks for your thorough answer much appreciated!

Thanks for your thorough answer much appreciated!