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

No sure way to tell whether an array is mutable?


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

Hi All.

I think I have just been burned by something sinister: an object says that it is an NSMutableArray, but turns out to be non-mutable. I'm wondering if anyone has run into this:

code snippet:

    if ( [newChildren isKindOfClass:[NSMutableArray class]] ) {
        HXDebug(@"Mutable:%@", newChildren);
    }
    [newChildren insertObject:entry atIndex:newIndex];

output:

DEBUG Mutable:()
*** -[NSCFArray insertObject:atIndex:]: mutating method sent to immutable object


Thanks for any insight!

-Kenny

_______________________________________________

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: No sure way to tell whether an array is mutable?
      • From: Jeff C <email@hidden>
    • Re: No sure way to tell whether an array is mutable?
      • From: Nick Zitzmann <email@hidden>
    • Re: No sure way to tell whether an array is mutable?
      • From: "R. Matthew Emerson" <email@hidden>
    • Re: No sure way to tell whether an array is mutable?
      • From: Graham Perks <email@hidden>
    • Re: No sure way to tell whether an array is mutable?
      • From: Chas Spillar <email@hidden>
  • Prev by Date: Re: Mount/Unmount events in Foundation tool
  • Next by Date: Re: No sure way to tell whether an array is mutable?
  • Previous by thread: Re: CoreData and Undo menu item title?
  • Next by thread: Re: No sure way to tell whether an array is mutable?
  • Index(es):
    • Date
    • Thread