Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSMutableDictionary returns nonsense?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary returns nonsense?




On Oct 27, 2010, at 7:14 AM, Robert Vojta wrote:

Hallo all,

I'm just starring at this in my gdb console and I have no idea how this is possible. What kind of thing can cause this?

Where's the problem. We have _requests NSMutableDictionary, which does contain one key / value pair. If I send valueForKey: message with existing key, it correctly returns pointer to a valid object.

If I send valueForKey: message with non existing key, it returns nil except one key - http://assets0.fusionads.net/automatic_2.jpg. It returns 0xffffffff pointer even if this key does not exists in _requests dictionary.


Don't use valueForKey - use objectForKey.

The former invokes various KVC related logic to the key (which, amongst other things, will attempt to translate "a.b" as a multiple part key path).



Glenn Andreas                      email@hidden 

The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSMutableDictionary returns nonsense? (From: Robert Vojta <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.