Re: Strange CFDictionary behaviour
Re: Strange CFDictionary behaviour
- Subject: Re: Strange CFDictionary behaviour
- From: Johan Malmstrom <email@hidden>
- Date: Tue, 28 Mar 2006 20:45:02 +0200
- Thread-topic: Strange CFDictionary behaviour
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" <email@hidden>:
> Try changing the CFDictionaryGetValueIfPresent call to:
>
> CFDictionaryGetValueIfPresent (
> myServiceDict,
> CFSTR("0100 - ServiceName*"),
> &value
>
> Greg
>
>
> On 3/27/06 8:36 AM, "Johan Malmström" <email@hidden> 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 (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden