NSData magic change
NSData magic change
- Subject: NSData magic change
- From: "gMail.com" <email@hidden>
- Date: Thu, 11 Nov 2010 12:57:34 +0100
- Thread-topic: NSData magic change
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 (email@hidden)
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:
This email sent to email@hidden