Why doesn't CFDictionaryContainsKey() work?
Why doesn't CFDictionaryContainsKey() work?
- Subject: Why doesn't CFDictionaryContainsKey() work?
- From: "Alan Smith" <email@hidden>
- Date: Thu, 16 Nov 2006 11:07:34 -0500
I added in my category of NSDictionary a method:
- (BOOL)hasKey:(id)key
{
return CFDictionaryContainsKey(self, *key);
}
I didn't get any compiler errors or warnings but when I used it, it
returned 0 every time. So I changed it to this:
- (BOOL)hasKey:(id)key
{
return [[self allKeys] containsObject: key];
}
And that works fine. The only problem I have with the latter code is
that allKeys may be very big and would slow my program down and use a
big chunk of memory.
So, if anyone can quell these fears please tell me.
Cheers, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unnecessary, then it
shall evolve."
_______________________________________________
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