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

Ribbit, highlight recipient state not going

Hi,

Going through the recipient stage of sending files and I've noticed in the app that when I select a recipient to send a file to it stays highlighted?

https://www.dropbox.com/s/orolxa6e55xdank/IMG_1065.PNG

Also I'm getting these errors in the console

2014-01-24 10:59:28.340 Ribbit[4099:60b] Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.

2014-01-24 10:59:28.359 Ribbit[4099:60b] Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.

2014-01-24 10:59:29.426 Ribbit[4099:60b] Received memory warning.

2014-01-24 10:59:35.190 Ribbit[4099:60b] Warning: Attempt to dismiss from view controller <UITabBarController: 0x15dd13710> while a presentation or dismiss is in progress!

2 Answers

youve got to deselect the cell programtically in your didSelectRowAtIndexPath method

[tableView deselectRowAtIndexPath:indexPath animated:YES];

as for the snapshot errors...they dont really make sense. Snapshots capture images of your actual views, sort of like a programmatic screen shot. But the ribbit app does not use snapshots anywhere. They are not the same as taking a picture using the image picker. Im not sure where those are coming from

I already have this in the code and it still doesn't de-select :/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];

    PFUser *user = [self.friends objectAtIndex:indexPath.row];

    if (cell.accessoryType == UITableViewCellAccessoryNone) {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
        [self.recipients addObject:user.objectId];
    } else {
        cell.accessoryType = UITableViewCellAccessoryNone;
        [self.recipients removeObject:user.objectId];
    }
}

Also got this

2014-01-24 16:15:36.082 Ribbit[2566:70b] Current user: jack

2014-01-24 16:15:39.200 Ribbit[2566:70b] Warning: Attempt to dismiss from view controller <UITabBarController: 0x9964190> while a presentation or dismiss is in progress!

  • (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath

thats didDeselectRow, not didSelectRow

Sorted, thanks!

Were you able to get rid of the error about snapshots?