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

Adding Checkmarks When the Table View is Loaded

For some reason I am getting the error:

"Property 'friends' not found in object of type 'EditFriendsViewController *'" in the prepareforsegue instance. I have imported the 'EditFriendsViewController.h' file to the 'FriendsViewController.m' and I have declared '@property (strong, nonatomic) NSMutableArray *friends;' in 'EditFriendsViewController.h'. What could be the problem?

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"showEditFriends"]) {
        EditFriendsViewController *viewController = (EditFriendsViewController *) segue.destinationViewController;
        viewController.friends = [NSMutableArray arrayWithArray:self.friends];

    };

}

2 Answers

What you have here looks right. I have the same void method. Perhaps there is a problem in the interface builder? I would either try to follow the video again or try searching for "Property not found in object of type" in Google which will send you to Stack overflow with some answers. Sorry that I cannot be more specific given what you have listed.

Hello Vinh, have you imported "EditFriendsViewController.h" in "FriendsViewController.m" OR "FriendsViewController.h" ?

#import "EditFriendsViewController.h"

Let me know if it worked. ;)