Last active
December 31, 2015 20:39
-
-
Save hfossli/8041396 to your computer and use it in GitHub Desktop.
Private, protected and public properties in objective-c
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
@interface DataObject : NSObject | |
// public properties | |
@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
#import "DataObject.h" | |
#import "DataObjectSubclass.h" | |
@interface DataObject () | |
// private properties | |
// + you must redclare all properties you declared in DataObjectSubclass.h | |
@end | |
@implemenation | |
// code | |
@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
#import "DataObject.h" | |
@interface DataObject (SubclassEyesOnly) | |
// protected properties | |
@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
#import "DataObject.h" | |
@interface ImageObject : DataObject | |
// public properties | |
@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
#import "DataObject.h" | |
#import "DataObjectSubclass.h" | |
@interface DataObject () | |
// private properties | |
@end | |
@implemenation | |
// code | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment