If I add the button straight everything goes fine. I'd really like to add it inside a view and still be able to click it. Here's the code:
UIView *containerView =
[[[UIView alloc]
initWithFrame:CGRectMake(0, 0, 300, 60)]
autorelease];
UIButton *footerButton = [UIButton buttonWithType:UIButtonTypeCustom];
footerButton.frame = CGRectMake(10, 10, 300, 40);
[footerButton addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
[containerView addSubview:footerButton];