Hello all,
can anyone please confirm this as a bug in WebObjects 5.3.1. When using an NSArray that is a to-many relationship from an entity, the listIterator() method returns an empty list if the NSArray has not had at least count() executed against it. The same happens when using the iterator() method.
Specifically, my code:
... scToCopy.toBOM().count();
bom = scToCopy.toBOM().listIterator();
while (bom.hasNext()) { BOM component = (BOM) bom.next();
...
works, but
... // scToCopy.toBOM().count();
bom = scToCopy.toBOM().listIterator();
while (bom.hasNext()) { BOM component = (BOM) bom.next();
...
does not loop at all. In the bug list there is issue 4169582 which applied to the iterator() method returning null values. It still doesn't seem to work for me. I've doubly confirmed that my install of XCode 2.3 went right and I have 5.3.1 installed.
It appears that whenever the fault is resolved, things go right. If the object (array) is still a fault, then the method doesn't work. Calling willReadRelationship doesn't seem to do it either ?? I really don't want to have count() in front of every iterator() call.
Thanks, John |