I’d like to declare a public immutable property:
@interface Foo @property(strong, readonly) NSSet *items; @end
…backed with a mutable type
The easiest solution is
@interface Foo { @private NSMutableSet* _items; } @property (readonly) NSSet* items;
and then just
@synthesize items = _items;
inside your implementation file. Then you can access the mutable set through _items but the public interface will be an immutable set.