Skip to content

Instantly share code, notes, and snippets.

@armadsen
Created January 7, 2013 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armadsen/4478942 to your computer and use it in GitHub Desktop.
Save armadsen/4478942 to your computer and use it in GitHub Desktop.
Demonstrates a class with an ivar and @Property with the same name. See http://stackoverflow.com/questions/14204534/issue-with-ivar/14204661#14204678
#import <Foundation/Foundation.h>
@interface MyClass : NSObject
{
id varA;
}
@property (nonatomic, strong) id varA;
@end
@implementation MyClass
@synthesize varA = _varA;
@end
int main(int argc, char *argv[]) {
@autoreleasepool {
[[[MyClass alloc] init] self];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment