• 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
NSData magic change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSData magic change
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error
  • Next by Date: Re: NSData magic change
  • Previous by thread: Re: sending msgs to nsoperation threads
  • Next by thread: Re: NSData magic change
  • Index(es):
    • Date
    • Thread