Created
September 6, 2010 00:01
-
-
Save jonathanpenn/566457 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
// I don't usually touch the AppDelegate anywhere else in the program | |
// so I'm not sure if this solves what you're trying to do or not. | |
// But, this should show the difference of how to declare public vs. | |
// private properties. | |
@interface SomeClass : NSObject { | |
// If you use LLVM then you don't have to declare the private var!! | |
} | |
@property (nonatomic, retain) NSString *somePublicStringProperty; | |
@end |
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
#include "SomeObject.h" | |
@interface SomeClass () // <- Empty parens means it's an anonymous category | |
// That makes it, in essence, private. | |
@property (nonatomic, retain) NSString *somePrivateStringProperty; | |
@end | |
@implementation SomeClass | |
@synthesize somePublicStringProperty, somePrivateStringProperty; | |
- (void)dealloc | |
{ | |
self.somePublicStringProperty = nil; | |
self.somePrivateStringProperty = nil; | |
[super dealloc]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment