• 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
immutable NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

immutable NSMutableDictionary


  • Subject: immutable NSMutableDictionary
  • From: Jérôme Laurens <email@hidden>
  • Date: Mon, 17 Feb 2003 13:39:55 +0100

In a rather normal piece of code, I came to a weird thing. Assuming myObject and myString are valid objects,

if([myDictionary isKindOfClass: [NSMutableDictionary class]])
{
[myDictionary setObject: myObject forKey: myKey];
}

when executing this code, I get an exception complaining that myDictionary is immutable.

How can it be possible?

I mean by normal piece of code a program where I do not poseAsClass, forwardInvocation, nor implement any of those "dangerous" runtime methods.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: immutable NSMutableDictionary
      • From: Ali Ozer <email@hidden>
    • Re: immutable NSMutableDictionary
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: helper application and embedded frameworks
  • Next by Date: Re: Displaying file contents in NSTextView
  • Previous by thread: helper application and embedded frameworks
  • Next by thread: Re: immutable NSMutableDictionary
  • Index(es):
    • Date
    • Thread