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 graham@bigpond.com wrote: On 7 Apr 2015, at 12:01 pm, Daryle Walker dary...@mac.com wrote: I have an object like: @interface MyClass : NSObject @property (readonly) NSArray * myDatumList; @property NSArray * myDataList; @end The

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 dary...@mac.com wrote: @interface MyClass : NSObject @property (readonly) NSArray * myDatumList; @property NSArray * myDataList; @end @implementation MyClass - (NSUInteger)countOfMyDatumList { return self.myDataList.count; } -

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 j...@mooseyard.com 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

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 quinceymor...@rivergatesoftware.com 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

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 dary...@mac.com 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

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 dary...@mac.com 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

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

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 dary...@mac.com 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