• 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: Rosyna <email@hidden>
  • Date: Tue, 25 Jun 2002 03:20:40 -0700

Of course, the problem with this being it won't work on 10.0.x ;) (no exception is thrown)

I've gone with Mike Shields' recommendation (thanks for all the others!) and it seems to be working for now.

To tackle that memory leak...

Ack, at 6/25/02, Andy Lee said:

But strictly speaking, if all you cared about was the right answer to the immutability question, it seems to me you could try actually sending a mutating message:

BOOL isImmutable = NO;

NS_DURING
[[myDictionary copy] setObject:@"foo" forKey:@"bar"];
NS_HANDLER
isImmutable = YES;
NS_ENDHANDLER

NSLog(@"isImmutable? %d", isImmutable);

Of course, this is pretty ugly and wasteful and unnecessary for Rosyna's purposes. But technically, it should work for all but a few cases where, for example, you define your own subclass of NSDictionary and do something weird.

--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me remember what we were talking about. Thanks.
_______________________________________________
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: Andy Lee <email@hidden>
References: 
 >Re: Mutable class problems (From: Sherm Pendley <email@hidden>)
 >Re: Mutable class problems (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Mutable class problems
  • Next by Date: Re: Dealloc method needed?
  • Previous by thread: Re: Mutable class problems
  • Next by thread: Re: Mutable class problems
  • Index(es):
    • Date
    • Thread