objective c - re-declaring readonly property in class extensions -


i reading document learn objective-c: https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/programmingwithobjectivec/customizingexistingclasses/customizingexistingclasses.html#//apple_ref/doc/uid/tp40011210-ch6-sw1

i topic "use class extensions hide private information" (page 73 of pdf) says: class extensions used extend public interface additional private methods or properties use within implementation of class itself. it’s common, example, define property readonly in interface, readwrite in class extension declared above implementation, in order internal methods of class can change property value directly.

what dont understand in statement since can change readonly property within private method defined in class extension without property being re-declared readwrite in class extension, achieve re-declaration of property readwrite?

you can change property through instance variable (_ivar = ...), won't able change using dot-property syntax (self.myprop =...) unless redeclare readwrite. need provide additional information whether property strong or weak in case.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -