ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread OC
Hi there, with ERXEOControlUtilities.objectCountForToManyRelationship I have bumped into a weird problem — with newly created EOs it fails, yelling that “... is not a toMany relationship! Expected an NSArray, but got null” (exact copy below). Now, perhaps I do something wrong, but it seems to m

Re: ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread Chuck Hill
I suspect your code. If it is newly inserted and saved (and even unsaved I think) they should be an empty array, not null. On 2016-04-13, 10:12 AM, "webobjects-dev-bounces+chill=gevityinc@lists.apple.com on behalf of OC" wrote: >Hi there, > >with ERXEOControlUtilities.objectCountFor

Re: ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread Ricardo Parada
I would make sure the EO has ERXGenericRecord somewhere in its class hierarchy that the EO is inserted in the editing context before you do anything with it. > On Apr 13, 2016, at 1:18 PM, Chuck Hill wrote: > > I suspect your code. If it is newly inserted and saved (and even unsaved I > th

Re: ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread OC
Thanks both of you. Very weird: always, far as I can recall, even years ago when in my hierarchy used to be EOGenericRecord instead of ERX... one, they were nulls :-O (Of course there is a slight probability my memory plays tricks on me, but I do recall in the old bad days when I used Java, I ha

Re: ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread Chuck Hill
Overriding awakeFromInsertion and not calling super? Chuck Hill Gevity Consulting Inc. Sent from my mobile device. > On Apr 13, 2016, at 11:27 AM, OC wrote: > > Thanks both of you. Very weird: always, far as I can recall, even years ago > when in my hierarchy used to be EOGenericRecord inste

Re: ERXEOControlUtilities.objectCountForToManyRelationship for new objects fails?

2016-04-13 Thread OC
On 13. 4. 2016, at 20:30, Chuck Hill wrote: > Overriding awakeFromInsertion and not calling super? Awesome. Precisely this I've found in the code; fixing it did fix the problem all right. (It is sort of nice that it has been there for years if not for decades, and never caused anything worse