Re: Out-of-bounds error when removing entry from NSForm
Re: Out-of-bounds error when removing entry from NSForm
- Subject: Re: Out-of-bounds error when removing entry from NSForm
- From: George Orthwein <email@hidden>
- Date: Tue, 15 May 2007 10:14:02 -0400
Just a guess... could it be that in your loop, as you remove rows,
the total row count reduces each loop so that curRow eventually
becomes out of bounds? You can remove the highest index first and
count down or perhaps a while loop like this would work:
while ([metadataForm numberOfRows])
{
[metadataForm removeEntryAtIndex:0];
}
I would stick with removeEntryAtIndex since the Form guide says to
use it:
http://developer.apple.com/documentation/Cocoa/Conceptual/Form/Tasks/
ManagingFormEntries.html
The reference for removeEntryAtIndex says "If the specified index is
invalid, this method does nothing." so I wonder why that was giving
you an error too. Maybe "invalid" does not include out of bounds?
Hope that helps,
George
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden