• 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: No sure way to tell whether an array is mutable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No sure way to tell whether an array is mutable?


  • Subject: Re: No sure way to tell whether an array is mutable?
  • From: Kenny Leung <email@hidden>
  • Date: Thu, 25 Jan 2007 18:40:46 -0800

Arrrgh! And we used to laugh at the Java guys because of this same problem.

-Kenny


On Jan 25, 2007, at 6:37 PM, Graham Perks wrote:


On Jan 25, 2007, at 8:21 PM, Kenny Leung wrote:
NSCFArray insertObject:atIndex:]: mutating method sent to immutable object


According to http://www.cocoadev.com/index.pl?NSMutableArray,

"This happens because of TollFreeBridging. Both NSArray and NSMutableArray are actually implemented using NSCFArray?, so the isKindOfClass: trick won't work here. As far as I know, there is no reliable, documented way to see whether an array is mutable or not besides trying it and seeing whether it works."

Awesome.

Graham Perks.


_______________________________________________

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


References: 
 >No sure way to tell whether an array is mutable? (From: Kenny Leung <email@hidden>)
 >Re: No sure way to tell whether an array is mutable? (From: Graham Perks <email@hidden>)

  • Prev by Date: Re: No sure way to tell whether an array is mutable?
  • Next by Date: Re: No sure way to tell whether an array is mutable?
  • Previous by thread: Re: No sure way to tell whether an array is mutable?
  • Next by thread: Re: No sure way to tell whether an array is mutable?
  • Index(es):
    • Date
    • Thread