• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Crazy CFPreferences!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crazy CFPreferences!


  • Subject: Re: Crazy CFPreferences!
  • From: Frederick Cheung <email@hidden>
  • Date: Mon, 18 Oct 2004 13:22:19 +0100


On 18 Oct 2004, at 12:24, SEBESTYÉN Gábor wrote:

Hi,

I actually writing (porting) a game which is mixed in Cocoa and C++ (using Core Foundation). I have a game config handler class written in c++ which uses CFPreferences API (I don't use it from Cocoa only via CF).
If I want to write to the preferences it badly crashes:



CFDictionaryRef dict0 = CFPreferencesCopyAppValue(ksect, kCFPreferencesCurrentApplication);
CFMutableDictionaryRef dict;
if (dict0) {
dict = CFDictionaryCreateMutableCopy(NULL, 0, dict0); // it crashes here
CFRelease(dict0);
} else {
dict = CFDictionaryCreateMutable(NULL, 1, NULL, NULL);
}

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.

Fred
_______________________________________________
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
  • Follow-Ups:
    • Re: Crazy CFPreferences!
      • From: SEBESTYÉN Gábor <email@hidden>
References: 
 >Crazy CFPreferences! (From: SEBESTYÉN Gábor <email@hidden>)

  • Prev by Date: Re: Obtaining the size of a directory
  • Next by Date: Re: Highlighting Drag Target
  • Previous by thread: Crazy CFPreferences!
  • Next by thread: Re: Crazy CFPreferences!
  • Index(es):
    • Date
    • Thread