Re: dataUsingEncoding: vs. archivedDataWithRootObject:
Re: dataUsingEncoding: vs. archivedDataWithRootObject:
- Subject: Re: dataUsingEncoding: vs. archivedDataWithRootObject:
- From: "James Chen a.k.a. 陳銘崧" <email@hidden>
- Date: Tue, 15 Mar 2005 18:08:59 +0800
DataUsingEncoding convert a NSString to specified encoding such as
NSASCIIStringEncoding.
[NSKeyedArchiver archivedDataWithRootObject] is doing serialization with the
root object which conforms to NSCoding protocol. The returned NSData
contains the encoded form of the object graph specified by the root object.
And you could use NSKeyedUnarchiver to decoded the data back to the object
graph.
In general, NSKeyedArchiver is used to produce the persistence, such as your
document file.
HTH,
James
On 3/15/05 1:20 PM, "Eric Lin" <email@hidden> wrote:
> What is the difference between calling [aString
> dataUsingEncoding:....] vs. [NSKeyedArchiver
> archivedDataWithRootObject:aString]?
>
> Thanks,
> Eric
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden