I have 3 sliders, all correctly hooked up to properties:
slider1, slider2, slider3
These sliders call an action handler:
sliderDidChange_(sender)
From what I have read, I SHOULD be able to query the sender to ascertain it’s title as follows:
sender’s title()
However, I get no results. I’ve tried putting “title” in pipes |title|(). I’ve tried loosing the parentheses. No luck. These are the variations that I have tried:
log sender’s title()
log sender’s |title|()
log sender’s title
log sender’s |title|
I get nothing in the console with any of these variations. So…what am I missing?
Thanks,
Brad
Brad,
Sliders don’t have titles – if you look at the attributes pane of the Inspector in IB, you will notice that there is no title field there for a slider. If you want to distinguish among several sliders, give each one a different tag (set in the attributes pane) and log sender’s |tag|.
Ric
Thanks Ric,
I KNEW I was missing something obvious. They always seem to be the hardest to find! :lol:
Brad
Even though the property name that you assign to a slider isn’t a title, you can still test whether the slider is the one with your property name – so, you can do this: “if sender is slider1 then do whatever”.
Ric