Hi Ken,
On Jan 15, 2011, at 7:36 AM, Ken Ferry wrote:
I'm not sure this has been made clear: It is intentional that it is
difficult to determine whether a dictionary is mutable.
That's because you shouldn't do it. Whether a dictionary is mutable _to_you_
is a matter of what's in the
On Jan 15, 2011, at 5:38 AM, Tito Ciuro wrote:
On Jan 15, 2011, at 7:36 AM, Ken Ferry wrote:
I'm not sure this has been made clear: It is intentional that it is
difficult to determine whether a dictionary is mutable.
That's because you shouldn't do it. Whether a dictionary is mutable
On Jan 15, 2011, at 1:04 PM, Ken Thomases wrote:
On Jan 15, 2011, at 5:38 AM, Tito Ciuro wrote:
On Jan 15, 2011, at 7:36 AM, Ken Ferry wrote:
I'm not sure this has been made clear: It is intentional that it is
difficult to determine whether a dictionary is mutable.
That's because
Le 15 janv. 2011 à 13:18, Tito Ciuro a écrit :
On Jan 15, 2011, at 1:04 PM, Ken Thomases wrote:
On Jan 15, 2011, at 5:38 AM, Tito Ciuro wrote:
On Jan 15, 2011, at 7:36 AM, Ken Ferry wrote:
I'm not sure this has been made clear: It is intentional that it is
difficult to determine
Hello,
Trying to determine whether an NSDictionary is mutable or not fails with these
two tests:
// Variable info could be NSDictionary or NSMutableDictionary. Assume it's an
NSDictionary.
BOOL isKindOfClass = [info isKindOfClass:[NSMutableDictionary class]];
BOOL respondsToSelector = [info
If you want to test if a dictionary is immutable, you are almost certainly
doing it wrong. When passed a dictionary in to a method either:
A) Make a mutable copy if that's what you need
B) -copy it if you want it to be immutable. (This is not inefficient as it
sounds because immutable objects
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order to
avoid calling mutableCopy each time, I thought it would be more efficient to
test it and then call mutableCopy only when needed.
On 14 Jan 2011, at 10:48, Tito Ciuro wrote:
Hello,
Trying to determine whether an NSDictionary is mutable or not fails with
these two tests:
// Variable info could be NSDictionary or NSMutableDictionary. Assume it's an
NSDictionary.
BOOL isKindOfClass = [info
On 14 Jan 2011, at 11:25, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order to
avoid calling mutableCopy each time, I thought it would be more efficient to
test
On 14-Jan-2011, at 7:25 PM, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order to
avoid calling mutableCopy each time, I thought it would be more efficient to
Hi Jonathan,
On Jan 14, 2011, at 12:34 PM, jonat...@mugginsoft.com wrote:
On 14 Jan 2011, at 11:25, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order to
avoid
On 14-Jan-2011, at 7:36 PM, Roland King wrote:
On 14-Jan-2011, at 7:25 PM, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order to
avoid calling mutableCopy each
On Fri, Jan 14, 2011 at 3:34 AM, jonat...@mugginsoft.com
jonat...@mugginsoft.com wrote:
On 14 Jan 2011, at 11:25, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its mutability before calling setObject:forKey:. In order
On 14 Jan 2011, at 11:43, Clark Cox wrote:
On Fri, Jan 14, 2011 at 3:34 AM, jonat...@mugginsoft.com
jonat...@mugginsoft.com wrote:
On 14 Jan 2011, at 11:25, Tito Ciuro wrote:
Hi Mike,
Given that the caller can pass a NSDictionary or an NSMutableDictionary, I
wanted to test its
Hi Pablo,
On Jan 14, 2011, at 1:35 PM, Pablo Pons Bordes wrote:
Hello,
To determine if a dictionary is mutable or Inmutable you just need to use the
isKindOfClass method, instead of use respondsToSelector.
I did a test to reproduce your problem and couldn't reproduce your problem,
so
Hello,
To determine if a dictionary is mutable or Inmutable you just need to use the
isKindOfClass method, instead of use respondsToSelector.
I did a test to reproduce your problem and couldn't reproduce your problem, so
my conclusion is that actually you are receiving a mutable Dictionary
So why I'm not able to reproduce your problem? There is three posible case:
1.- I maid wrong the Test.
2.- You are making wrong If statement (maybe an assignment instead of compare
)
3.- Something really estrange happens.
good luck
Pablo
El 14/01/2011, a las 12:44, Tito Ciuro escribió:
Hi
On 14-Jan-2011, at 8:44 PM, Tito Ciuro wrote:
Hi Pablo,
On Jan 14, 2011, at 1:35 PM, Pablo Pons Bordes wrote:
Hello,
To determine if a dictionary is mutable or Inmutable you just need to use
the isKindOfClass method, instead of use respondsToSelector.
I did a test to reproduce
On Jan 14, 2011, at 7:57 AM, Roland King wrote:
Again let me say that if the signature to your method is
-(void)doSomethingWithADictionary:(NSDictionary*)dictionary;
you shouldn't be trying to figure out whether that dictionary is mutable and
mutate it.
Yup.
If you want it to
On Jan 14, 2011, at 4:44 AM, Tito Ciuro wrote:
Hi Pablo,
On Jan 14, 2011, at 1:35 PM, Pablo Pons Bordes wrote:
Hello,
To determine if a dictionary is mutable or Inmutable you just need to use
the isKindOfClass method, instead of use respondsToSelector.
I did a test to reproduce
Thanks a lot everyone for the great feedback. I really appreciate it! :-)
Cheers,
-- Tito
On Jan 14, 2011, at 6:39 PM, Corbin Dunn wrote:
On Jan 14, 2011, at 4:44 AM, Tito Ciuro wrote:
Hi Pablo,
On Jan 14, 2011, at 1:35 PM, Pablo Pons Bordes wrote:
Hello,
To determine if a
I'm not sure this has been made clear: It is intentional that it is
difficult to determine whether a dictionary is mutable.
That's because you shouldn't do it. Whether a dictionary is mutable
_to_you_ is a matter of what's in the header for the method you obtained it
from.
Suppose that some
22 matches
Mail list logo