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 trialTimothy Watson
1,662 PointsEditFriendsViewController.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
42,016 Pointsthis could be the issue:
UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath];
should be
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
Timothy Watson
1,662 PointsThanks 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
42,016 PointsIts 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.
Timothy Watson
1,662 PointsThanks for your thorough answer much appreciated!
Timothy Watson
1,662 PointsThanks for your thorough answer much appreciated!
Stone Preston
42,016 Pointsno problem : )
Timothy Watson
1,662 PointsTimothy Watson
1,662 PointsThanks 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?