Darkroom
Jun 28, 2009, 02:00 PM
what is the proper syntax to achieve this ultra simple action... grrr... what i have below apparently is incorrect. UISlider's value changed is connected to the action.
- (IBAction)changeAlpha:(id)sender
{
[self.mainView setAlpha:[sender value]];
}
Error: incompatible type for argument 1 of 'setAlpha'
writing either [sender intValue] or [sender floatValue] (depending on how the slider's values appear) causes a crash.
[edit] nevermind. i figured it out. sender of UISlider can't be generic type (interesting!)... has to be
- (IBAction)changeAlpha:(UISlider *)sender
- (IBAction)changeAlpha:(id)sender
{
[self.mainView setAlpha:[sender value]];
}
Error: incompatible type for argument 1 of 'setAlpha'
writing either [sender intValue] or [sender floatValue] (depending on how the slider's values appear) causes a crash.
[edit] nevermind. i figured it out. sender of UISlider can't be generic type (interesting!)... has to be
- (IBAction)changeAlpha:(UISlider *)sender
