Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Saving CFArray/CFDict/CFData to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving CFArray/CFDict/CFData to disk




On 24 May 2007, at 11:02, Bernie wrote:


Thanks for the suggestions George. I'd already checked those (sorry, I should have mentioned it).


I've now created a simplified example project to show the problem: <http://homepage.ntlworld.com/bernie.w/ReadWriteCFArrayTest.zip> (20K). After doing a File>Save As, the example creates an array with just one CFData element which is created from a struct containing just one CFString. Once the XML data is created and written to disk, opening the file in Property List Editor shows the data element as empty (<>).

The array create and write functions:


CFDataReplaceBytes( data, CFRangeMake( 0, sizeof(DBData) ), (UInt8*) &cellData, sizeof(DBData) );
That range parameter should be pointing at a valid range of your CFData, which it isn't (since data is empty). Use CFDataAppendBytes or say that you want to replace the range 0,0
In addition if you think this would fill the data with the bytes that make up the string, it won't. The best you'll get is the bytes corresponing to the address of the cfstring




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >re: Saving CFArray/CFDict/CFData to disk (From: George Warner <email@hidden>)
 >Re: Saving CFArray/CFDict/CFData to disk (From: Bernie <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.