-(void)setState:(id)sender { UIButton* button = (UIButton*)sender; BOOL buttonBool = ([button state]==selected : YES ? NO); [sender setSelected:buttonBool++]; }
This is my idea, but I cannot determine the actual state of the button that calls the function. any button that calls this function must be switched between the standard and selected states, so that it works like a switch. I just need to have my own background graphics, otherwise I used a switch.
So can someone fix my idea?
objective-c iphone uibutton togglebutton
nico
source share