I find this issue very puzzling.

I read a plist dictionary containing one ony key-value: an NSData coming a
RTFD string. I read this value, I do NO changes, then I re-save it to a
different plist file, and now the 2 files are different. I have inspected
these 2 plist files with TextWrangler, and the difference is at the last
chars of the <data> object. These chars change 'every time' I save. Why?
How can I get 2 equal dicts?

docDictR = [NSDictionary dictionaryWithContentsOfFile:@"/Dict1.plist"];
textDataR = [docDictR objectForKey:@"textData"];
mString = [[NSMutableAttributedString alloc] initWithRTFD:textDataR
documentAttributes:nil];

// now I save it

textRangeW = NSMakeRange(0, [mString length]);
textDataW = [mString RTFDFromRange:textRangeW documentAttributes:nil];
docDictW = [NSMutableDictionary dictionary];
[docDictW setObject:textDataW forKey:@"textData"];
[docDictW writeToFile:@"/Dict2.plist" atomically:YES];


Dict1.plist last chars of the <data> object
ALS20y2AQAAAAAAAAAAAAA=

Dict2.plist last chars of the <data> object
DHV20y2AQAAAAAAAAAAAAA=


Regards
Leonardo


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to