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
Paul Cisneros
1,332 PointsBuild a Self-Destructing Message iPhone App and iOS 7 issues
So far I've completed in this iOS project up to "Relating Users in Parse.com".
One problem I've noticed both in the simulator and on an iPhone 4s is that in the EditFriendsViewController.m:
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { ....
The checkmarks that are supposed to appear and disappear when selecting and removing friends only do so after selecting a row after the one you initially intended to add/remove a checkmark.
For example, if you tap Amit's row to add as a friend, a checkmark will only appear next to Amit after the next row tapped like if you tapped Ben.
I'm assuming that this is an change in iOS 7.
This is also affecting how the data is updated on Parse, because I do not see the changes updating correctly.
Has any one at TeamTreehouse seen this or has found a solution?
2 Answers
Stone Preston
42,016 PointsI dont think this has anything to do with iOS 7 changes, but it may. It looks like you have what is known as an "off by one" error going on here. Basically somewhere you referenced an array and your index is off by one. I would double check anywhere you reference indexPath, IndexPath.row, or any array that you have created. Also be sure that you have the number of rows in your table view set correctly.
Lamar Greene
9,581 PointsI had this same problem...
it is because you used,
- (void)tableView:(UITableView *)tableView **did*Deselect*RowAtIndexPath:**(NSIndexPath *)indexPath
instead of
- (void)tableView:(UITableView *)tableView **did*Select*RowAtIndexPath:**(NSIndexPath *)indexPath
The difference is "didDeselectRow..." as opposed to "didSelectRow...", caused me a headache for about 30 min.
Paul Cisneros
1,332 PointsPaul Cisneros
1,332 PointsI think you're right, however, I couldn't find where I messed up. There were a couple of lines in the code where I was off from the project files on the site. However, I fixed these lines according to the code, but didn't fix my code.
Only fully replacing my EditFriendsViewController.m code from the site's provided code did I get it to work. Must have been a really small error somewhere.