Tuesday, September 21, 2021

#1 2021-07-28 02:30:31 am

tellboy
Member
Registered: 2005-06-23
Posts: 155

Losing NSTableView object in script

Coming back to ASOC after a long while and finding my feet again.

I have an NSTableView.
It is linked by referencing in IB to a property in a script.
The script has been declared as a custom class in IB using the blue cube.

On awake from nib I get

Applescript:

on awakeFromNib()

log pAccountTable
end awakeFromNib

<NSTableView: 0x100623f90>

When I call another handler in the same script I get:

Applescript:

on loadDataArray:tRecordArray
set pDataArray to NSMutableArray's arrayWithArray:tRecordArray
pAccountTable's reloadData()
end loadDataArray:

*** +[AccountTableController loadDataArray:]: missing value doesn’t understand the “reloadData” message. (error -1708)

Why is pAccountTable now missing value.

Thanks for any help

Terry

Offline

 

#2 2021-07-28 05:41:26 am

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

Re: Losing NSTableView object in script

It looks like you're calling loadDataArray: as a class method on the AccountTableController class, whereas your awakeFromNib() handler suggests pAccountTable belongs to an instance.


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

Offline

 

#3 2021-07-28 06:09:00 am

tellboy
Member
Registered: 2005-06-23
Posts: 155

Re: Losing NSTableView object in script

Thanks for your reply. When you create a controller with a blue cube is that item an instance method?

If yes and you make a reference by dragging in IB to another pAccountTable:missing value item then I presume that pAccountTable is a reference to the original?

As clear as mud description, he,he

Thanks

Terry

Offline

 

#4 2021-07-28 05:14:05 pm

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

Re: Losing NSTableView object in script

tellboy wrote:

When you create a controller with a blue cube is that item an instance method?



It's an instance.

If yes and you make a reference by dragging in IB to another pAccountTable:missing value item then I presume that pAccountTable is a reference to the original?



That makes a reference, yes.

Your problem is with how/where you call loadDataArray:.


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

Offline

 

#5 2021-07-30 05:48:56 am

tellboy
Member
Registered: 2005-06-23
Posts: 155

Re: Losing NSTableView object in script

Thanks for the pointer.

I have managed to figure it out.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)