Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.