Class vs Instance Methods


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. @interface MyClass : NSObject
  2. + (void)aClassMethod;
  3. - (void)anInstanceMethod;
  4. @end
  5.  
  6. [MyClass aClassMethod];
  7. MyClass *object = [[MyClass alloc] init];
  8. [object anInstanceMethod];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.