If you need to fake a touch event and not simply call a UIButtons method, you can use this: [MyButtonName sendActionsForControlEvents: UIControlEventTouchUpInside];
Category: Buttons
Using Images In Buttons
Designing Graphics Use a 10px rounded corner for iPhone and iPad button graphics if you want to match the standard button shape. If not set the button 'Type' to 'Custom' so that is become transparent other than your image. Dealing with iPhone4 vs iPhone3 resolutions You can list any image as [email protected] along with Image.png […]
Changing Button Properties
Changing In A Method Called By A Button – (IBAction)MyButton:(id)sender { UIButton *ThisButton = (UIButton *)sender; [ThisButton setTitle:@”1234″ forState:UIControlStateNormal]; ThisButton.titleLabel.font = [UIFont systemFontOfSize:9]; } Changing From Anywhere In the .h file add this IBOutlet UIButton *MyButton; Link the button in interface builder If your View could get unloaded you must release objects you’ve created (or […]
Adding A Button
Define in the .h file } – (IBAction)myButtonPressed:(id)sender; Create the function – (IBAction)myButtonPressed:(id)sender { } Connect In Interface Builder Right click, select ‘Touch Up Inside’ and drag button onto ‘Files Owner’, select myMethodName If you want to call the function from other code [self myButtonPressed:nil];