How to get object id from UIButton ? I want to know which uibutton is pressed currently when i don't save the pointer to uibutton.
Not alot to your question so it's hard to understand what you're asking... But, I'll hazard a guess by making the assumption that you're asking for how to get access to a UIButton from within your code? If so, then I'd need to also assume you'd added this button via Interface Builder in which case you simply need to add an IBOutlet
pre-processor directive for each button object in your view controller (or view's) interface as such:
@interface MyView : UIViewController {
UIButton *myButton;
}
@property (nonatomic, retain) IBOutlet UIButton *myButton;
// Button's action which you probably already figured out
- (IBAction)buttonPressed:(id)sender;
Then you'll need to make the connections in Interface Builder. Drag FROM the object that needs to know TO the object it needs to know about. So you'd control-drag from the File's Owner to the UIButton to connect the IBOutlet...and then control-drag from the UIButton back to the File's Owner to connect the IBAction.