Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is this correct behavior?



Moving from GCC 4 to 3.3 is a much larger step for me than moving from CW to Xcode. I encountered several small issues with code that used to work but suddenly stopped. Most where easy to get around by rearranging the code.

Now I'm totally stuck on a problem. I have code that used to work fine but stopped to work either when I moved from GCC 4 to 3.3 or I changed some settings in Xcode. Have I been getting away with something illegal before or is there a problem/setting I missed?

This does not work (key is not found in dictionary):
-------------
#define kMyKey CFSTR("myKey")

CFMutableDictionaryRef dictRef = ::CFDictionaryCreateMutable(nil, 0,nil,nil);
CFDictionarySetValue(dictRef,kMyKey,CFSTR("myValue"));
CFStringRef returnedValue = CFDictionaryGetValue(dictRef,kMyKey);
CFShow(returnedValue); // null


This works:
-------------
#define kMyKey CFSTR("myKey")

CFStringRef key = kMyKey;
CFMutableDictionaryRef dictRef = ::CFDictionaryCreateMutable(nil, 0,nil,nil);
CFDictionarySetValue(dictRef,key,CFSTR("myValue"));
CFStringRef returnedValue = CFDictionaryGetValue(dictRef,key);
CFShow(returnedValue); // "myKey"


Grateful for any hints!

Rune
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.