If assign is a setter, but a property is readonly, then it will not be doing any setting, so why use assign ?
I am getting this from the Apple docs on class extensions. In this page, I get why you’d want a public readonly property, then make it privately readwrite, but then why not omit the assign from the public @interface and just include it in the class extension only?
If you declare a
@propertymultiple times (typically because you declare a publicreadonlyproperty in the header file, and areadwriteproperty in an anonymous category in your .m), the memory management schemes have to match.So if you have this in your .m:
Then you need this in your header, and the
assignis mandatory: