• 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: Mutable class problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutable class problems


  • Subject: Re: Mutable class problems
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 24 Jun 2002 17:45:39 -0700

On Monday, June 24, 2002, at 05:11 PM, Rosyna wrote:

I have a method that can receive either Mutable or Immutable
Dictionaries. I try to determine what to do with the passed in
argument based on that. I am also trying to use isMemberOfClass:
method to determine if it's mutable. But...

NSStringFromClass([dict class]); //returns NSCFDictionary when dict
is declared as NSMutableDictionary

And

NSStringFromClass([NSMutableDictionary class]); //returns NSMutableDictionary.

Is there another way to determine if it's immutable or not?

Generally speaking, what you should be doing is making a -copy or a -mutableCopy of the given collection, depending on what you need it to be.

How about filling us in on what you're doing?

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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: Mutable class problems
      • From: Rosyna <email@hidden>
References: 
 >Mutable class problems (From: Rosyna <email@hidden>)

  • Prev by Date: NSMutableDictionary -> NSData
  • Next by Date: Re: NSMutableDictionary -> NSData
  • Previous by thread: Mutable class problems
  • Next by thread: Re: Mutable class problems
  • Index(es):
    • Date
    • Thread