Re: Local Properties

2012-09-05 Thread Andreas Grosam
On 04.09.2012, at 07:52, Graham Cox wrote: > > On 04/09/2012, at 3:24 PM, Gerriet M. Denkmann wrote: > >> I have a class with a mutable array. But from outside it should be just a >> read-only non-mutable array. >> Is there a better (more elegant) way? > > Just return the internal (mutable)

Re: Local Properties

2012-09-03 Thread Graham Cox
On 04/09/2012, at 3:24 PM, Gerriet M. Denkmann wrote: > I have a class with a mutable array. But from outside it should be just a > read-only non-mutable array. [] > Is there a better (more elegant) way? Just return the internal (mutable) array as an NSArray. By typing it as an NSArray, you

Re: Local Properties

2012-09-03 Thread David Duncan
On Sep 3, 2012, at 10:24 PM, Gerriet M. Denkmann wrote: > I have a class with a mutable array. But from outside it should be just a > read-only non-mutable array. > My current solution: > > MyClass.h file contains: > > @property (readonly, nonatomic) NSArray *externalArray; > > and MyCl

Local Properties

2012-09-03 Thread Gerriet M. Denkmann
I have a class with a mutable array. But from outside it should be just a read-only non-mutable array. My current solution: MyClass.h file contains: @property (readonly, nonatomic) NSArray *externalArray; and MyClass.m file has: @interface MyClass() @property (strong) NSMutableArray *int