Re: NSArray.iterator and NSArray.listIterator bug
Re: NSArray.iterator and NSArray.listIterator bug
- Subject: Re: NSArray.iterator and NSArray.listIterator bug
- From: John Larson <email@hidden>
- Date: Thu, 15 Jun 2006 05:22:54 -0500
Thanks Chuck,
objectEnumerator does work. I didn't even think that that would be a
different implementation except for Iterator's remove() method. Oh
well, just trying to obey Sun's advice about their Collections
framework and not have to call methodWithAsLongANameAsPossible(). :-)
John
On Jun 14, 2006, at 10:45 PM, Chuck Hill wrote:
I can't confirm it, but I would not be surprised. Sounds like
whoever added this method neglected to fire the fault before
creating the iterator. I'll suggest using objectEnumerator()
instead of calling count().
Chuck
On Jun 14, 2006, at 7:35 PM, John Larson wrote:
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming sometime... - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/
practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden