Re: Crazy CFPreferences!
Re: Crazy CFPreferences!
- Subject: Re: Crazy CFPreferences!
- From: Frederick Cheung <email@hidden>
- Date: Mon, 18 Oct 2004 19:57:35 +0100
On 18 Oct 2004, at 19:07, SEBESTYÉN Gábor wrote:
Since you create the dictionary with null callbacks it doesn't retain
objects you add to it. I'd guess that because of this dict0 may
contain
already released (ie junk) values, from the first time the data was
saved.
I didn't create dictionaries as you might see in the code snippet I
sent.
- First I get a dict with CFPreferencesCopyAppValue(ksect,
kCFPreferencesCurrentApplication);
- Then I create a mutable copy CFDictionaryCreateMutableCopy(NULL, 0,
dict0);
The program crashes at this point.
You do create one in the case where CFPreferencesCopyAppValue returns
null, and then you store that dict (which will contained a bogus value
since the dict doesn't retain it) which may well be screwing
CFPreferences up.
Maybe you're right. In that case I don't really know how to prevent
this illogic crash. I simply cannot find another way to create a dict
in safe way (retained) and make the other copied to it.
If you have any idea how to solve this I would appreciate.
I would create the dictionary with kCFTypeDictionaryKeyCallBacks and
kCFTypeDictionaryValueCallBacks
Fred
Best regards,
Gábor
_______________________________________________
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