Op 19-11-2010 3:51, Ken Thomases schreef:
I of course want the items to be read only for the outside world, but the
object itself should be able to modify it. Now the compiler complains about the
properties not matching. How should I solve this? Make a custom getter that
returns an immutable
On 19 Nov 2010, at 02:51, Ken Thomases wrote:
You don't need to implement the getter. The Cocoa docs are very clear that
callers must respect the declared type of properties (i.e. return type of
getters). That is, if the getter is declared to return an immutable NSArray,
then
On Nov 19, 2010, at 10:29 AM, jonat...@mugginsoft.com wrote:
If I receive an NSArray instance from a method I can for example identify
the index of a particular object within the array, say at idx, safe in the
knowledge that my object is at the given index.
If however the object I
On Nov 18, 2010, at 7:51 PM, Ken Thomases wrote:
On Nov 18, 2010, at 9:33 AM, Keary Suska wrote:
On Nov 18, 2010, at 5:35 AM, Remco Poelstra wrote:
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray
On Nov 19, 2010, at 10:00 AM, Keary Suska wrote:
So, I think we should write code to guarantee immutability to the caller,
regardless of type of course, which is the API contract you spell out. I see
the easiest way as always returning a copy in the getter. But I don't
remember how
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray *items;
@end
I also have a protocol as follows:
@protocol Proto
@property (nonatomic,readonly) NSArray *items;
@end
I of course want the items to be read only
On 18 Nov 2010, at 12:35, Remco Poelstra wrote:
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray *items;
@end
I also have a protocol as follows:
@protocol Proto
@property (nonatomic,readonly)
On 18 Nov 2010, at 13:01, jonat...@mugginsoft.com wrote:
On 18 Nov 2010, at 12:35, Remco Poelstra wrote:
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray *items;
@end
I also have a protocol as
On Nov 18, 2010, at 5:35 AM, Remco Poelstra wrote:
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray *items;
@end
I also have a protocol as follows:
@protocol Proto
@property (nonatomic,readonly)
On Nov 18, 2010, at 9:33 AM, Keary Suska wrote:
On Nov 18, 2010, at 5:35 AM, Remco Poelstra wrote:
Hi,
I've a object like to following:
@interface Proto {
NSMutableArray *items;
}
@property (nonatomic,readonly) NSMutableArray *items;
@end
I also have a protocol as follows:
10 matches
Mail list logo