What’s wrong with these lines?
set n to gNavigationBar’s selectedSegment()
set k to gNavigationBar’s tagForSegment_(n as integer)
if gives:
-[NSSegmentedControl tagForSegment:]: unrecognized selector sent to instance
What’s wrong with these lines?
set n to gNavigationBar’s selectedSegment()
set k to gNavigationBar’s tagForSegment_(n as integer)
if gives:
-[NSSegmentedControl tagForSegment:]: unrecognized selector sent to instance
The tag belongs to the control’s cell, not the control itself, so try:
set k to gNavigationBar's |cell|()'s tagForSegment_(n as integer)
The selectedSegment() already gives you a number that identifies which segment was selected, so unless you have multiple segmented controls that have the same action message and you need to distinguish between them, I don’t think you would need to use the tag.
Ric
Oh yes, the “wrapping cell”, thank you – I feel I’ll have recurrent problems with this NextSTEP concept…
I used the selectedSegment() method, and of course it works, I just have a button AND a menu command doing the same thing (as it’s not possible to attribute a keyboard equivalent to an individual segment) and I wish to attribute them the same unique “command number” (in the tag) for code clarity.
Thank you for the tip – by the way, “cell” is piped in your post – is “cell” a keyword in ApplescriptObjC ?
Yes, if you type cell()'s, the editor changes it to cell{}'s in blue.
Ric