Re: Mutable class problems
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.