Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Synthesized properties in Objective-C without instance variables

View Foo.h
1 2 3
@interface Foo : NSObject {}
@property(assign) float foo;
@end
View Foo.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#import "Foo.h"
 
// Private interface
@interface Foo ()
@property(assign) float bar;
@end
 
@implementation Foo
@synthesize foo, bar;
 
- (void) doSomething
{
foo = bar = 1;
}
 
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.