‘AppleScriptObjC Explored’: Addenda and Errata
The current version is 4.0.1 (see inside the cover for the version number).
* IN chapter 8, Drag and Drop, a way of emulating just an open handler is described, using a property, fileList, to store the list of files to open. However, the code provided does not actually set the value of the property; the variable fileList in the application_openFiles_ handler is a local variable.
The solution is to insert the following statement in the application_openFiles_ handler:
set my fileList to fileList
The differences between 4.0.0 and 4.0.1 are as follows:
* CHANGE to the Mastering Build Settings section on pages 232-233. With the release of Xcode 4.6, it is no longer necessary to change compiler. The modified text reads as follows:
If you are running Xcode 4.4 or 4.5, you may want to change the value under Build Options for Compiler for C/C++/Objective-C. Apple includes two compilers — its own LLVM, and LLVM GCC 4.2 — and also offers a Default setting, which chooses LLVM. Normally this should not matter, because the compiler is irrelevant for AppleScriptObjC code. However, LLVM 4.1, which ships with Xcode 4.4 and 4.5, has a problem with applications that use garbage collection when run in 64-bit mode under OS X 10.6. The result is that if you wish your application to be able to run under OS X 10.6, and you are using Xcode 4.4 or 4.5, you should either set LLVM GCC 4.2 as the compiler, or set your application to run in 32-bit mode under OS X 10.6.
This problem has been fixed in Xcode 4.6, where you should use the default setting (Apple LLVM Compiler 4.2). (The GCC 4.2 compiler option will disappear in the next major version of Xcode.)
* THE last paragraph on page 179 is:
log ws's getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type_("/", specifier, specifier, specifier, specifier, specifier)
As the text that preceeds it implies, that should be:
log ws's getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type_("/", reference, reference, reference, reference, reference)
* IN the project in chapter 7, A Class of Our Own, the section on reimporting tabbed data begins on page 57. The inital handler on page 57, importDataAsTabbedText_(sender), and the specFromTabbedText_(tabbedText) handler on page 58, both import values for the number of columns and depth of ads as text rather than numbers. The result is that if you try to sort a column by clicking on a column heading after an import, you may get a crash — the values cannot be sorted unless they are all numbers or all text, not a mixture of both.
On page 57, this code:
Should be changed to:
setAdColumns_(adCols as integer)
setAdDepth_(adDep as integer)
And on page 58, this code:
setAdColumns_(item 2 of theValues)
setAdDepth_(item 3 of theValues)
should be changed to:
setAdColumns_((item 2 of theValues) as integer)
setAdDepth_((item 3 of theValues) as integer)
The code in the projects also needs to be changed similarly.
* IN several chapters there are references to Myriad Helpers, and a copy of a project demonstrating them is included with the book. The included version will not compile with older versions of Xcode. If you have this problem, you can download a compatible version here