I’ve seen this in some demo code:
@property (readonly) SomeObject* someInstance;
What was lacking to my eye is any mention of either assign, copy or retain; if omitted, what type of pointer is it? Obviously it is a pointer of some kind, but I’d think in the absence of retain or copy all pointers would simply be assign since they simply point to and equal whatever someInstance is.
But I don’t want to make such assumptions. Properties seem deceptively simple to understand, when actually the concept can be a bit difficult to wrap you head around, I find.
The other values (retain, copy, assign) only matter when you have a setter involved. Any getter generated with any of those attributes will be the same. The retain, copy, or assign only really apply when you are setting values because you are changing the behavior of what the setter will do with the object passed in. Since this property is readonly, it means you are only creating a getter to return the pointer of the object, it doesn’t matter what anything else is because you can’t set it anyway.