• 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: Creating/saving/appending to files the Cocoa way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Creating/saving/appending to files the Cocoa way
      • From: Craig Williams <email@hidden>
References: 
 >Re: Creating/saving/appending to files the Cocoa way (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: NSSavePanel oddity
  • Next by Date: Re: Creating/saving/appending to files the Cocoa way
  • Previous by thread: Re: Creating/saving/appending to files the Cocoa way
  • Next by thread: Re: Creating/saving/appending to files the Cocoa way
  • Index(es):
    • Date
    • Thread