Monday, April 22, 2019

#1 2018-11-17 12:31:48 am

technomorph
Member
Registered: 2017-12-14
Posts: 103

Xcode Views their elements and Applescript

Hi I have two views that are identical.
I'd like to simply my code so that I can set elements of each separate view.

1st ly I'll create to properties.
property _aView : missing value
property _bView : missing value

then should I connect those to each of the individual views as Referencing Objects?

next question is can I access the subelements (containers) (what should I call those)?
in each view somehow?  And do I reference them by the name I've give to the element(object)?

like:

Applescript:

set processView to _aView
processView's track setStringValue:"Test"
set processView to _bView
processView's track's setStringValue:"Test Track"
processView's artist's setStringValue:"Test Artist"

Do I need to set up any of the subelements to reference anything?
their outlets, delegates, referencing outlets?

Is there a better way to do this via a Object Controller, Dictionary Controller or
a Data Model?

thanks


Filed under: xcode, views

Offline

 

#2 2018-11-17 05:15:23 am

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

Re: Xcode Views their elements and Applescript

The general approach is to create outlets for any view you need to address. Referring to subviews by index just leads to fragile code that can break when you modify the nib.


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

Offline

 

#3 2018-11-17 05:35:14 am

technomorph
Member
Registered: 2017-12-14
Posts: 103

Re: Xcode Views their elements and Applescript

Yeah that's what I have going now.
As it was direct and basic. 
But I figured there may be a better way as I was liking arounin all the
Controllers available.

Glad to know and I'll proceed with coding the rest of it

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)