Re: Making an array property without a backing store. How?

2015-04-07 Thread Graham Cox
> On 8 Apr 2015, at 3:58 am, Daryle Walker wrote: > > Looking at the debugger again, I noticed that my BOOL property with a custom > getter (which simulates its result based on other member data) also has a > “_myFlag” backing store. Is there some setting we’re missing, or do I have to > file

Re: Making an array property without a backing store. How?

2015-04-07 Thread Greg Parker
> On Apr 6, 2015, at 7:01 PM, Daryle Walker wrote: > > I have an object like: > > @interface MyClass : NSObject > @property (readonly) NSArray * myDatumList; > @property NSArray * myDataList; > @end > > The second member is meant to be an actual data member, an array of mutable > dictionari

Re: Making an array property without a backing store. How?

2015-04-07 Thread Charles Srstka
On Apr 7, 2015, at 2:33 PM, Jens Alfke wrote: > > What Quincey said. I banged my head against this a lot back in 2005 or so and > gave up on this approach. It sounds lovely — I can expose this property as an > NSArray in my class’s public API even though it’s not really implemented as > an NSA

Re: Making an array property without a backing store. How?

2015-04-07 Thread Jens Alfke
> On Apr 7, 2015, at 11:55 AM, Quincey Morris > wrote: > > The problem is that this approach doesn’t actually work, not in this form. > There’s a little bit of Doing It Wrong™, but mostly this is pretty badly > broken in Cocoa. What Quincey said. I banged my head against this a lot back in 2

Re: Making an array property without a backing store. How?

2015-04-07 Thread Quincey Morris
On Apr 7, 2015, at 10:58 , Daryle Walker wrote: > @interface MyClass : NSObject > @property (readonly) NSArray * myDatumList; > @property NSArray * myDataList; > @end > > @implementation MyClass > > - (NSUInteger)countOfMyDatumList { >return self.myDataList.count; > } > > - (id)objectInM

Re: Making an array property without a backing store. How?

2015-04-07 Thread Daryle Walker
> On Apr 6, 2015, at 10:18 PM, Graham Cox wrote: > >> >> On 7 Apr 2015, at 12:01 pm, Daryle Walker wrote: >> >> I have an object like: >> >> @interface MyClass : NSObject >> @property (readonly) NSArray * myDatumList; >> @property NSArray * myDataList; >> @end >> >> The second member is me

Re: Making an array property without a backing store. How?

2015-04-06 Thread Graham Cox
> On 7 Apr 2015, at 12:01 pm, Daryle Walker wrote: > > I have an object like: > > @interface MyClass : NSObject > @property (readonly) NSArray * myDatumList; > @property NSArray * myDataList; > @end > > The second member is meant to be an actual data member, an array of mutable > dictionari

Making an array property without a backing store. How?

2015-04-06 Thread Daryle Walker
I have an object like: @interface MyClass : NSObject @property (readonly) NSArray * myDatumList; @property NSArray * myDataList; @end The second member is meant to be an actual data member, an array of mutable dictionaries. The first member isn’t supposed to have a backing store; accessing a