• 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
Re: RTFDFromRange returns different data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RTFDFromRange returns different data


  • Subject: Re: RTFDFromRange returns different data
  • From: "gMail.com" <email@hidden>
  • Date: Thu, 11 Nov 2010 22:16:23 +0100
  • Thread-topic: RTFDFromRange returns different data

Thank you Glenn. Me too I thought of a time stamp because
I tried to call that function several times with 1 second interval and the
data was different by 1, then 2, then 3...

I workedaround the problem archiving the data directly from the
attributedString this way:

NSData* stringData = [NSKeyedArchiver
archivedDataWithRootObject:mTextMutableString];

It works like a charm. Thanks.
And I think there should always be a way to get the "same" out-data, given
the same "in-variables".

--
Leo

> Da: glenn andreas <email@hidden>
> Data: Thu, 11 Nov 2010 08:21:18 -0600
> A: "gMail.com" <email@hidden>
> Cc: <email@hidden>
> Oggetto: Re: RTFDFromRange returns different data
>
>
> On Nov 11, 2010, at 8:12 AM, gMail.com wrote:
>
>> RTFDFromRange returns different data even if I do not change the variables
>> mTextMutableString nor mDocAttributes. I just call several time:
>>
>> NSData  *textData = [mTextMutableString RTFDFromRange:textRange
>> documentAttributes:mDocAttributes];
>> NSLog(@"textData %@", textData);
>>
>> And 'every time' I get a different textData log text.
>> Of course I compare the text starting from <
>>
>> For example, at any call I get
>> (this is the last changing part of the log text)
>> 1)  edecdb4c b6010000 00000000 00000000>
>> 2)  2aebdb4c b6010000 00000000 00000000>
>> 3)  a6f8db4c b6010000 00000000 00000000>
>> 4)  bef8db4c b6010000 00000000 00000000>
>>
>> Why does RTFDFromRange returns a different data, even if the variables
>> didn't change? How to get the same data? Is it a bug?
>
>
>
> RTFDFromRange returns an archived (flattened) version of RTFD, which is
> undocumented but probably includes things like time stamps or unique IDs.  So
> it is not a bug - archiving the same original data is not guaranteed to return
> byte-for-byte identical archived results (but will return the same thing when
> unarchived).
>
>
> Glenn Andreas                      email@hidden
> The most merciful thing in the world ... is the inability of the human mind to
> correlate all its contents - HPL
>


_______________________________________________

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: RTFDFromRange returns different data
      • From: Martin Wierschin <email@hidden>
References: 
 >Re: RTFDFromRange returns different data (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: sending msgs to nsoperation threads
  • Next by Date: Re: Detecting reading a key in KVC
  • Previous by thread: Re: RTFDFromRange returns different data
  • Next by thread: Re: RTFDFromRange returns different data
  • Index(es):
    • Date
    • Thread