I see two approaches to handling sender objects in IBAction statements. The first is as follows:
-(IBAction)buttonPressed:(id)sender{
UIButton*someButton=(UIButton*)sender;
}
To others it seems easier:
-(IBAction)buttonPressed:(UIButton*)sender{
}
I generally choose version 2. Any special reasons prefer one style over another, if you know that only this button will send this method?
I see where version 1 is good if something can be the sender, for example, a button or switch or slider, etc. But if you are looking for properties UIButtonsuch as tag, this will not make much difference if your sender is not UIButton. So version 2 seems a lot simpler.
Just thought that I would see if I have an obvious reason to prefer version 1.