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 Checkmarks When the Table View is Loaded

Ryan Summe
Ryan Summe
4,618 Points

Instead of writing the isFriend method, I tried to use `if ([self.friends containsObject:user])` but it doesn't work.

If doesn't seem to be able to match the user object with the objects in the self.friends array. Any idea why this doesn't work?

2 Answers

Ryan, here is a full template for the social network application: Click Here.

Ryan Summe
Ryan Summe
4,618 Points

This was explained in the following video. It doesn't work because the containsObject method checks that every attribute of the given object is identical. Whenever Parse pulls info from their servers, there are slight differences. You need to match on the users objectIDs.