Use of * in Objective C Syntax

Posted by user263097 on Stack Overflow See other posts from Stack Overflow or by user263097
Published on 2010-04-10T19:31:43Z Indexed on 2010/04/10 19:43 UTC
Read the original article Hit count: 453

Filed under:

I'm struggling a bit with some objective c syntax. Can someone please elaborate on the usage of * in the following instance method.

- (IBAction)sliderChanged:(id)sender{
    UISlider *slider = (UISlider *)sender;
}

I realize that we are creating a variable typed as UISlider and then setting it to sender once it is cast as a UISlider. However, I don't understand what the * are for and why

UISlider slider = (UISlider)sender; 

won't work.

© Stack Overflow or respective owner

Related posts about objective-c