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)
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
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
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