¡@

Home 

2014/10/15 ¤U¤È 10:13:58

iphone Programming Glossary: setmyproperty

objective-c ARC readonly properties and private setter implementation

http://stackoverflow.com/questions/8566671/objective-c-arc-readonly-properties-and-private-setter-implementation

@property nonatomic retain readonly NSString myProperty @end private interface declaration @interface SomeClass void setMyProperty NSString newValue @end @implementation SomeClass void setMyProperty NSString newValue if myProperty newValue myProperty.. interface declaration @interface SomeClass void setMyProperty NSString newValue @end @implementation SomeClass void setMyProperty NSString newValue if myProperty newValue myProperty release myProperty newValue retain void doSomethingPrivate self setMyProperty.. NSString newValue if myProperty newValue myProperty release myProperty newValue retain void doSomethingPrivate self setMyProperty @ some value that only this class can set @end With ARC if I wanted to override setMyProperty you can't use retain release..