Problem with El Capitan

With updating to EC(OS X 10.11) I get problems now.

Even this simple handler makes a problem:


property NSMutableArray : class "NSMutableArray"
property vDataSource:{}
property vTableView: missing value

on awakeFromNib()
       mainWindow's makeFirstResponder_(maxPunkteFeld)
       set vDataSource to NSMutableArray's alloc()'s init()
       set theData to {{untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"6", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"5-", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"5", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"5+", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"4-", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"4", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"4+", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"3-", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"3", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"3+", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"2-", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"2", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"2+", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"1-", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"1", spanne:""}, {untereGrenze:"", bis:"-", obereGrenze:"", dieNote:"1+", spanne:""}}
      --log theData -- it logs well
        vDataSource's addObjectsFromArray_(theData)
        -- formatiereZahlen("0")
        vTableView's reloadData()
   end awakeFromNib

errormessage:
2015-10-02 19:35:45.126 Notenverteilung[486:45390] *** -[AppDelegate awakeFromNib]: unable to set argument -1 - the AppleScript value (null) could not be coerced to type q. (error -10000)

What’s on now there? Any idea?

Heiner

What happens if you insert “my”, as in:

set my vDataSource to NSMutableArray’s alloc()'s init()

Hallo Shane,

no it doesn’t work. It should show the datas ‘theData’ in the table view.

By the way, I get this message too:
Notenverteilung: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/QXPScriptingAdditions.osax” cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.

???

Try changing:

vDataSource's addObjectsFromArray_(theData)

to:

set my vDataSource to theData

That means you have a very old copy of QXPScriptingAdditions.osax on your system. It does no harm, but throwing it out will get rid of the message.

I deleted the file in the library and I got the message of.

But the attampt:

has no seccess.

Have you checked the value of your properties? I don’t see maxPunkteFeld and mainWindow there.

Both are set as missing value above and bound to a text field respectively to a window .

To repeat my remarks on top: The app worked up to OSX 10.10 properly and I have the same problem at another app. I have no good feeling.

For anyone lurking, I’ve had a look at Heiner’s project and found the problem, and it’s something that’s likely to bite quite a few apps, I fear.

In a nutshell, the project has a property vTableView that is an IBOutlet to a table view, and he uses a datasource method. So the method starts like this:

	on numberOfRowsInTableView:aTableView
		if aTableView is my vTableView then

Now although aTableView and vTableView are the same thing, this test is returning false: comparing two pointers for equality is failing. This is likely to crop up in delegate methods, too.

As a workaround, you can instead use something like this:

	on numberOfRowsInTableView:aTableView
		if aTableView's self() is vTableView's self() then

This is a simpler workaround, although they are both untested on systems before 10.11:

on numberOfRowsInTableView:aTableView
       if aTableView is vTableView() then