Drag and Drop works well in Tiger, not in Panther

OK, I’ve got a tough one. I’ve added drap-and-drop capabilities to a tab view item via a custom view in a tab view in a window and that works well in Tiger, the problem is that when run in Panther (it’s not an option to have separate versions) I get an immediate NSCannotCreateScriptCommandError (10) triggered by the registration of drag types in the awake from nib handler. Here’s the code:

if the name of theObject is "DropZone" then
		-- We will register for the following types (altough this example only responds to the "string" type).
		tell theObject to register drag types {"string"}
	end if

Any ideas why Panther would reject this and not Tiger?


I’ve got more information on this problem from trial and error. It seems that ANY item in Interface Builder when hooked to the “Drop” and “Awake from NIB” events will function well in Tiger but cause the NSCannotCreateScriptCommandError (10) in Panther. It’s not the code itself, but merely having the “Drop” and “Awake from NIB” vents checked in the Object in IB.

I’ve also checked to see if there’s any listed Panther/Tiger incompatibilities. There’s not. I’m going to upgrade to the latest version of Xcode to see if that helps but I’m afraid that there may be other issues. This seems like an Xcode bug.

Anyone else seen anything like this?

Well I have the same problem when I use in different applescritp text files an awake from nib. Everything seems to be okay but when I run the Release version of my application on an 10.3.9 machine it will rain with NSCannotCreateScriptCommandError.

This is probably an Xcode bug. I worked around it by registering the drag types in the “on opened” handler and the problem went away.