• 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: Error: mutating method sent to immutable object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error: mutating method sent to immutable object


  • Subject: Re: Error: mutating method sent to immutable object
  • From: Greg Guerin <email@hidden>
  • Date: Sat, 4 Apr 2009 12:12:42 -0700

Priscila J.V wrote:

thanks for your advice but now the message in the log window is:
*** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)

Can you please suggest me something to fix it?

Bug-fixing tip number 1: Don't do that.

In particular: Stop trying to index past the end of the array.

Take a close look at your 'for' loop, and consider what happens if the array contains fewer than 7 items.

Then look at the basic documentation for NSArray and read about the - count method.

  -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Error: mutating method sent to immutable object
      • From: Priscila J.V. <email@hidden>
  • Prev by Date: Re: UITableView "port" to Mac?
  • Next by Date: Re: Toll-free bridge type at runtime
  • Previous by thread: RE: Error: mutating method sent to immutable object
  • Next by thread: RE: Error: mutating method sent to immutable object
  • Index(es):
    • Date
    • Thread