Objective C - Properties


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



Copy this code and paste it in your HTML
  1. // SomeClass.h
  2.  
  3. #import <Foundation/Foundation.h>
  4.  
  5. @interface SomeClass : NSObject {
  6. int mynumber;
  7. NSString *mystring;
  8. }
  9.  
  10. @property(readwrite/readonly, assign/retain/copy, nonatomic) int mynumber;
  11. @property(readwrite/readonly, assign/retain/copy, nonatomic) NSString* mystring;
  12.  
  13. @end
  14.  
  15. // SomeClass.m
  16.  
  17. #import "SomeClass.h"
  18. @implementation SomeClass
  19.  
  20. @synthesize mynumber, mystring;
  21.  
  22. @end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.