UIButton *myButton = [[UIButton alloc] init...];
[myButton addTarget:something action:@selector(myAction) forControlEvents:UIControlEventTouchUpInside];
- method1: without subclass of UITableViewCell
//first need to set tag to UIButton
//then reference it by its tag as below
UIButton *button2 = (UIButton *)[[cell contentView] viewWithTag:2];
- method2: with subclass of UITableViewCell
//add connection of UIButton to IBOutlets in UITableViewCell
//then easily reference the button via
cell.myButton
-(void) buttonpressed:(UIButton *)sender
{
NSString* launchUrl = @"http://apple.com/";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: launchUrl]];
}
self.button.layer.masksToBounds = YES;
self.button.layer.cornerRadius = 5.0;
[[self.button layer] setBorderWidth:2.0f];
[[self.button layer] setBorderColor:[UIColor whiteColor].CGColor];