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: Sun, 17 Jan 2010 17:32:08 -0500
- Thread-topic: Creating/saving/appending to files the Cocoa way
On 1/17/10 5:07 PM, "Shane Stanley" <email@hidden> wrote:
> I'd be inclined to stick to read/write commands because NSFileHandle
> requires making sure your text is an NSString and then encoding it as data
> before writing. I haven't done any timings, but I wonder if the extra
> AS-Cocoa to-and-fro might actually slow things down.
Ah...that's kind of annoying. Since I'm writing a string every second,
(possibly faster), too much of a slowdown could be annoying. (yes, I know,
cache it then write later. However, since we're conceivably talking about
someone say, wandering through every room on a floor in a hotel while this
app gathers stats, that could get complicated, and I'm not a good enough
programmer for complicated. Not yet at least. Besides, this way, if the
stupid thing crashes and the user chose to save data, the data's still
saved.)
>
> If you do use read/write, be aware that you have to enclose the commands in
> a "tell current application" for them to work.
Makes sense, thanks for the tip. Currently dealing with the joys of
NSSavePanel, and commenting my code at something like a 4:1 ratio of
comments to code.
--
"These things we do that others may live."
USAF Pararescue
_______________________________________________
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