Re: Creating/saving/appending to files the Cocoa way
Re: Creating/saving/appending to files the Cocoa way
- Subject: Re: Creating/saving/appending to files the Cocoa way
- From: "John C. Welch" <email@hidden>
- Date: Wed, 20 Jan 2010 14:56:08 -0500
- Thread-topic: Creating/saving/appending to files the Cocoa way
On 1/17/10 6:07 PM, "Shane Stanley" <email@hidden> wrote:
>> Since I'm writing a string every second, (possibly faster), too much of a
>> slowdown could be annoying.
>>
> You're probably not going to notice any difference. I just did some simple
> tests, and make-NSString/make-NSData/use-NSFileHandle took about five times
> as long as using AS's write (using a single line of text). Sounds awful, but
> it's a case of 5,000 writes a second vs 25,000 a second -- academic if
> you're writing a small amount once a second.
A question on NSString to NSData:
I've got this bit:
set theFileData to my NSData's |data|()
set theFileString to my NSString's stringWithString_("This is a test")
log theFileString
set theFileData to theFileString's dataUsingEncoding_(NSUTF8StringEncoding)
Everything works up to the last line.
When the dataUsingEncoding step runs, I get:
The variable NSUTF8StringEncoding is not defined. (error -2753)
I checked the class definitions, no typos or odd caps, and my other NSString
ops work correctly, so I'm a bit puzzled at the error.
--
Politics:
A strife of interests masquerading as a contest of principles. The conduct
of public affairs for private advantage.
Ambrose Bierce
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden