ADC Home > Reference Library > Technical Q&As > Carbon > Human Interface Toolbox >
|
Q: I am using GetDataBrowserUserState so that I can write my DataBrowser control's user state out to disk. (The user state is information about user customizable settings in the control, such as column widths and orderings.) I tried to call CFDataGetLength on the CFDataRef returned by GetDataBrowserUserState, but this resulted in a crash with "EXC_BAD_ACCESS" on Mac OS X. What am I doing wrong? A: Unfortunately, the prototype for GetDataBrowserUserState (in Mac OS X 10.2.x and previous) is incorrect; GetDataBrowserUserState does not pass back a CFDataRef, it passes back a CFDictionaryRef. You can use CFPropertyListyCreateXMLData to convert the CFDictionaryRef into a CFDataRef, thereby making it possible to call CFDataGetLength on the result. For example:
[Jul 22, 2003] |
|