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

why id should be equal. And what is id?

-(BOOL) isFriend:(PFUser *)user{ for(PFUser *friend in self.friends){ if([friend.objectId isEqualToString:user.objectId]) return YES; } return NO; }

why id should be equal if they are friends?

2 Answers

Troy Fine
Troy Fine
7,592 Points

Your farther ahead of me in the island so maybe I can answer your second question.

id is a pointer to an object data structure. id is a general purpose type for objects, unlike int or char which are used with specific purpose and memory allocation sizes. id can refer to any kind of object regardless of class. Basically all objects in Objective-C are actually of type id regardless of their instance variables or methods.

Think I came across this info on the Apple Developer Website when looking up NSObject or something.

Ow, it should be individual unique id. So if even names or whatever is equal but id is different.