Created
November 25, 2010 20:41
-
-
Save kylesluder/715888 to your computer and use it in GitHub Desktop.
Demo of synthesized ivar scope
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
#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