Created
July 17, 2009 03:26
-
-
Save rentzsch/148842 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
// As-is, this code results in a compiler warning: | |
// warning: property 'name' requires method '-name' to be defined - use @synthesize, @dynamic or provide a method implementation | |
// warning: property 'name' requires the method 'setName:' to be defined - use @synthesize, @dynamic or provide a method implementation | |
// Set NEEDS_DYNAMIC to 1 to silence the warning. | |
#import <Foundation/Foundation.h> | |
#define NEEDS_DYNAMIC 0 | |
@interface MyClass : NSObject | |
@property (retain) NSString *name; | |
@end | |
@implementation MyClass | |
#if NEEDS_DYNAMIC | |
@dynamic name; | |
#endif | |
@end | |
int main (int argc, const char * argv[]) { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment