The contents of someArray can be changed, although the property is not (i.e., the call cannot change the value of the instance variable someArray , assigning it to the property). Note that this is different from the semantics of C ++ const . If you want the array to be actually readable (i.e. not readable), you need to wrap it with a special accessor. In @interface (assuming your someArray property)
@property (readonly) NSArray *readOnlyArray;
and in @implementation
@dynamic readOnlyArray; + (NSSet*)keyPathsForValuesAffectingReadOnlyArray { return [NSSet setWithObject:@"someArray"]; } - (NSArray*)readOnlyArray { return [[[self someArray] copy] autorelease]; }
Note that the caller will still be able to change the state of the objects in the array. If you want to prevent this, you must make them immutable when pasting, or make a depp copy of the array in Access readOnlyArray .
source share