Alex Rivera | Logout

plus (+) versus minus (-) in objective-c

Asked 2012-06-08T18:20:16.487
24

Possible Duplicate:
What do the plus and minus signs mean in Objective C next to a method?

What's the difference between using a plus or minus in Objective-C?

For example, most of the time code starts -(void)somethingSomethingelse, but sometimes it will be +(void)somethingSomethingelse

Thanks!

Edit
Report

1 Answer

6

member and public functions respectively.

Such that

id object = [[NSObject alloc] init];
+ (id)alloc;
- (id)init;

Where NSObject is a Class and id is an object

If you have ever used C++, a + is equivalent to static

answered 2012-06-08T18:23:35.603

Your Answer