Created
January 6, 2015 23:04
-
-
Save slembcke/df529e4c3df3bc38695b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the .h file | |
@interface Foo : Bar { | |
@public | |
int _ivar1; | |
@protected | |
int _ivar2; | |
int _property2; | |
@private | |
int _ivar3; | |
} | |
// This will automatically declare a private "int _property1" ivar. (unless you implement both the getter and setter) | |
@property int property1; | |
// This property will use the use the _property2 ivar you declared above. | |
@property int property2; | |
@end | |
// in the .m file | |
@implementation Foo { | |
// You can put ivars in here too. | |
// They _can_ be public/protected, but there isn't much point unless you declare them in the header. | |
int _ivar4; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment