Folks-
On page 50, when I try to do an initial compile I get the following error. I’ve rebuilt the project a few times with the same results:
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Tue Aug 2 18:04:28 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “x86_64-apple-darwin”.tty /dev/ttys001
[Switching to process 24447 thread 0x0]
2012-01-04 16:09:06.818 Ad Table[24447:903] An uncaught exception was raised
2012-01-04 16:09:06.820 Ad Table[24447:903] Cannot create BOOL from object <_NSControllerObjectProxy: 0x20048e9e0> of class _NSControllerObjectProxy
2012-01-04 16:09:06.822 Ad Table[24447:903] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Cannot create BOOL from object <_NSControllerObjectProxy: 0x20048e9e0> of class _NSControllerObjectProxy’
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff875517b4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff813cd0f3 objc_exception_throw + 45
2 CoreFoundation 0x00007fff875515d7 +[NSException raise:format:arguments:] + 103
3 AppKit 0x00007fff88582e78 _NSBoolFromValue + 443
4 AppKit 0x00007fff885828ef -[NSEditableBinder _setStatesImmediatelyInObject:mode:triggerRedisplay:] + 368
5 AppKit 0x00007fff88582778 -[NSEditableBinder _observeValueForKeyPath:ofObject:context:] + 116
6 AppKit 0x00007fff884c7a33 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 557
7 AppKit 0x00007fff884a4546 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1172
8 AppKit 0x00007fff884a288d loadNib + 226
9 AppKit 0x00007fff884a1d9a +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248
10 AppKit 0x00007fff884a1bd2 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326
11 AppKit 0x00007fff8849f153 NSApplicationMain + 279
12 Ad Table 0x0000000100000efa main + 74
13 Ad Table 0x0000000100000ea4 start + 52
)
terminate called after throwing an instance of ‘NSException’
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)
Thanks,
Ralph
Could you post the code that causes this error? It’s kinda hard to help with just this. 
Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)
Sure- it’s a pretty basic tutorial piece that isn’t even built out very much. Just a table, a couple of buttons, an array controller, and a new class built. I have a feeling it might have something to do with the Bindings…? The second script is the new class, a separate doc.
Not sure how much help the AScode will be:
script AdTableAppDelegate
property parent : class “NSObject”
property theData : {}
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
script Ad
property parent : class “NSObject”
property adDescription : “Ad name”
property adColumns : 0
property adDepth : 0
end script
First, I think you can’t have more than one script objects in one AS file. You have two. You can create a second AS file and insert your code in this second file, and create a blue cube in your XIB/NIB and assign the script as it’s class.
Last, the code inside the second one will never be called from within the delegate setup like this. But you could merge all this code into one like this, and it should work:
script AdTableAppDelegate
property parent : class "NSObject"
property adDescription : "Ad name"
property adColumns : 0
property adDepth : 0
property theData : {}
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
But there isn’t much in there like you said. Probably just removing the second script block will solve the problem. The object controller for the script delegate must be expecting just one and never was made for more than one, thus the error.
Let me know if this helps.
Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)
From the error message I guess that there is a binding problem.
A key whose value should be boolean is not
Or that… of course, we don’t have your complete project in front of us. But I am confident that either suggestion should solve the problem. 
No, you can have multiple classes in one file.
Really? Didn’t know that… Tx! Then, Stefan’s suggestion should be it…
Stefan is on the money – it looks like a bindings problem. If you’re still stuck, email me.
Sorry- those scripts are two separate files. That’s what the tutorial is about: creating a separate file and a new class.
yes, I’m pretty sure it’s a binding issue as I’ve done hardly any coding. Does anyone know where I should look for the improper binding based on the error it threw?
So far I’ve created a 3 column table, bound the three columns to the array controller, an add and delete button also bound to the array controller add: and remove: methods, the delete button is also bound to the array controller with a controller key of canRemove. I think that’s all i’ve done…
Ok, so I went through and rebuilt the tutorial one step at a time, and found the error point (I’ll be doing this from here on out, seems like a good double-check method).
The instructions I followed: “Drag an array controller from the Object Library to the Objects section of the dock area, and in the Bindings Inspector bind its Content Array to the Model Key Path ‘theData’ in the ‘app delegate’”
When I build and run I get an error. I’ve done this in earlier tutorials, so I wondered if it was related to a new class/file I had been instructed to create. To that end, I found if I delete that file, it builds fine.
These are the instructions to build said file: "Now you need to make the Ad class, which is a bit tricky in Xcode 4; unlike Xcode 3, at the time of writing it did not have an AppleScript class template. Go to Xcode’s File menu and choose ‘New>New File’…Click on Mac OS X then Other on the left, then select the Empty icon; click Next. Name the file Ad.applescript and click Save. Ad.applescript should appear in the Ad Table group of the Project Navigator. Click on the new class and it will appear blank in the editing pane. You need to set it up as a script class by defining a script object and setting its parent property like this:
Script Ad
property parent : class "NSObject"
property adDescription : "Ad name"
property adColumns : 0
property adDepth : 0
end script
So, I’m wondering if that’s where the bindings are going wrong, or if
Ok, now I just got it to work. The only thing I did differently is adding the array controller before making the new class file, then binding the controller. weird.