Skip to content

Instantly share code, notes, and snippets.

@kylesluder
Created November 25, 2010 20:41
Show Gist options
  • Save kylesluder/715888 to your computer and use it in GitHub Desktop.
Save kylesluder/715888 to your computer and use it in GitHub Desktop.
Demo of synthesized ivar scope
#import <Foundation/Foundation.h>
@interface Foo : NSObject
{ /* Notice there's nothing here */ }
@property(nonatomic,retain) id someVar;
- (void)unrelated;
@end
@implementation Foo : NSObject
@synthesize someVar;
- (void)unrelated {
// Note the lack of self-> for direct ivar access
NSLog(@"%@", [someVar description]);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment