site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Thread-index: AcZRvKMt4gOGpL2vEdqyMgAKlXc8vAAJ+QS8ACzMYXA= Thread-topic: Strange CFDictionary behaviour User-agent: Microsoft-Entourage/11.2.3.060209 Thanks x 4! As a most obvious mistake I thank you for the kind corrections I got. This of course solved my problem. Only sad thing is that was not what I really wanted to do. What I really wanted to do was: CFStringRef ServiceName = IOBluetoothSDPServiceRecordGetServiceName(HIDServiceRecord)); I get "EXC_BAD_ACCESS" here, and I'm guessing I'm still doing some basic fault. The definition of "IOBluetoothSDPServiceRecordGetServiceName" extern CFStringRef IOBluetoothSDPServiceRecordGetServiceName( IOBluetoothSDPServiceRecordRef serviceRecord) Anyone got some wisdom to share? / Johan Den 06-03-27 23.22, skrev "Greg Herlihy" <greghe@pacbell.net>:
Try changing the CFDictionaryGetValueIfPresent call to:
CFDictionaryGetValueIfPresent ( myServiceDict, CFSTR("0100 - ServiceName*"), &value
Greg
On 3/27/06 8:36 AM, "Johan Malmström" <jmalmstrom@mac.com> wrote:
Well strange to me anyway...
I have a problem accessing the values in my CFDictionary that I have created from a .plist file. I can get all keys and values by using the " CFDictionaryGetKeysAndValues" function but when using "CFDictionaryGetValueIfPresent" I get "EXC_BAD_ACCESS". I appreciate any kind of help. This is more or less what I'm doing:
CFDictionaryRef myServiceDict;
myServiceDict = CreateMyDictionary(); /* reads a plist file, based on CreateMyPropertyListFromFile found in the " Property List Programming Topics for Core Foundation" */
// This works CFStringRef keys[100], values[100]; CFDictionaryGetKeysAndValues ( myServiceDict, keys, values );
// and I can use my dict to correctly do this: result = IOBluetoothAddServiceDict( myServiceDict, &HIDServiceRecord); // result is kIOReturnSuccess on return
// But this crashes, although I have confirmed that "0100 - ServiceName*" is a key in the CFDictionary
CFStringRef value; Boolean jom_test = CFDictionaryGetValueIfPresent ( myServiceDict, "0100 - ServiceName*", &value );
If I could get some input here it would make my day!
Thanks! / Johan
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (Carbon-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/greghe%40pacbell.net
This email sent to greghe@pacbell.net
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Johan Malmstrom