Re: 'kASAppleScriptSuite' undeclared
Re: 'kASAppleScriptSuite' undeclared
- Subject: Re: 'kASAppleScriptSuite' undeclared
- From: Michael Tsai <email@hidden>
- Date: Tue, 2 Oct 2007 15:08:24 -0400
On Oct 2, 2007, at 1:29 PM, Matt Neuburg wrote:
The method that you used is actually quite dangerous, especially
when using
AppleScript; many of those literal four-character codes such as
'ascr' can
turn out to be incorrect on an Intel machine (though I do not know
whether
that one, in particular, would turn out to be so). Linking to
Carbon and
using the global name of the constant is the Right Way, and solves
that
problem.
Importing the header is the right thing to do, but I think what he
did was safe.
In this case, linking is unnecessary because it's a compile-time
constant, not a global variable. Apple cannot change
kASAppleScriptSuite to a different four-char code without breaking
every app that uses it.
Four-char codes don't have endian problems so long as you treat them
as numbers.
--Michael
_______________________________________________
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