For example, I have a UISlider that calls - (IBAction)sliderMoved:(id)sender, which performs some task once a new value has been “slid” to through the Value Changed event. But what if I want to do something based on whatever its initial value is?
Hard-coding something to match the default value in Interface Builder would be sloppy and hard to debug later if someone changes the nib file. So, how can I access the default value set for this UISlider in Interface Builder?
AND, more generally speaking, how does one access these attributes for any such UI element? Are there setter/getter methods already synthesized for these?
As Maunil said, Use bindings to connect the UISlider in InterfaceBuilder to a UISlider object in the code. Once this is done, you can access all its methods & properties.
To set the initial value, use the setValue: property of the UISlider, something like:
See the UISlider Class Reference documentation for more information.