• 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: Determining if NSArray/NSDictionary is immutable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining if NSArray/NSDictionary is immutable


  • Subject: Re: Determining if NSArray/NSDictionary is immutable
  • From: Douglas Davidson <email@hidden>
  • Date: Sat, 9 Jul 2005 12:41:05 -0700


On Jul 8, 2005, at 8:08 PM, email@hidden wrote:

And to cut a riposte off at the pass, I'm not interested in arguing about the language semantics and theorising subtleties - in my particular case I'm writing testers for code which I think really should be returning mutable or immutable instances strictly, so simply saying "it says it returns NSDictionary, so just don't mutate it" isn't a good enough answer.


If that is the standard against which you are testing, then I would suggest trying to mutate the object and catching the resulting exception. That would seem to be the actual crux of the matter being tested--that an exception should be thrown on invalid operations. A complete test suite will of course test that exceptions are thrown when they are required.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Determining if NSArray/NSDictionary is immutable (From: email@hidden)

  • Prev by Date: Re: Importance of thread safety and performance.
  • Next by Date: Adding internet passwords to the keychain
  • Previous by thread: Re: Determining if NSArray/NSDictionary is immutable
  • Next by thread: Re: Determining if NSArray/NSDictionary is immutable
  • Index(es):
    • Date
    • Thread