• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Out-of-bounds error when removing entry from NSForm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Out-of-bounds error when removing entry from NSForm
      • From: Sam Stigler <email@hidden>
References: 
 >Out-of-bounds error when removing entry from NSForm (From: Sam Stigler <email@hidden>)

  • Prev by Date: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Next by Date: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Previous by thread: Out-of-bounds error when removing entry from NSForm
  • Next by thread: Re: Out-of-bounds error when removing entry from NSForm
  • Index(es):
    • Date
    • Thread