Sunday, December 17, 2017

#1 2015-10-02 12:50:21 pm

Heiner
Member
From:: Germany
Registered: 2007-08-25
Posts: 147

Problem with El Capitan

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

Even this simple handler makes a problem:

Applescript:


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

Last edited by Heiner (2015-10-03 06:27:46 am)

Offline

 

#2 2015-10-02 06:32:53 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Problem with El Capitan

What happens if you insert "my", as in:

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


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2015-10-03 05:15:13 am

Heiner
Member
From:: Germany
Registered: 2007-08-25
Posts: 147

Re: Problem with El Capitan

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.

???????????

Offline

 

#4 2015-10-03 06:53:08 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Problem with El Capitan

Heiner wrote:

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


Try changing:

Applescript:

vDataSource's addObjectsFromArray_(theData)

to:

Applescript:

set my vDataSource to theData

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.


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.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#5 2015-10-03 11:16:20 am

Heiner
Member
From:: Germany
Registered: 2007-08-25
Posts: 147

Re: Problem with El Capitan

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

But the attampt:

set my vDataSource to theData


has no seccess.

Offline

 

#6 2015-10-03 04:16:37 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Problem with El Capitan

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


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#7 2015-10-03 06:52:00 pm

Heiner
Member
From:: Germany
Registered: 2007-08-25
Posts: 147

Re: Problem with El Capitan

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.

Offline

 

#8 2015-10-04 07:18:50 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Problem with El Capitan

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:

Applescript:

   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:

Applescript:

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


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#9 2015-10-04 10:53:23 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Problem with El Capitan

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

Applescript:

on numberOfRowsInTableView:aTableView
if aTableView is vTableView() then


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)