Re: Determining if NSArray/NSDictionary is immutable
Re: Determining if NSArray/NSDictionary is immutable
- Subject: Re: Determining if NSArray/NSDictionary is immutable
- From: email@hidden
- Date: Sun, 10 Jul 2005 12:18:35 +1000
> Given that you are writing a test harness, can you safely attempt to modify the returned collection and catch the exception if it is immutable?
>
> I.e.
>
> @try {
> [returnArray addObject; 0];
> } @catch {id e} {
> /// nope, not mutable
> return;
> }
>
> // hey, we mutated... boo.
Well, yes, that's what I've done for the moment, as I said in my original post. It works well enough, except it requires enabling ObjC exceptions. No real biggy, but I do a lot of framework and library development, and hate solutions which complicate the build process, since that makes using my stuff harder for others.
Wade Tregaskis (AIM, Yahoo & Skype: wadetregaskis, AIM audio/video chat: email@hidden, ICQ: 40056898, MSN: email@hidden, Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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