UIBarButtonItem exclusive touch
UIBarButtonItem exclusive touch
- Subject: UIBarButtonItem exclusive touch
- From: Leon Qiao <email@hidden>
- Date: Tue, 30 Aug 2011 10:34:23 +0800
Dear all,
The UI I made is like the system app "Contact", there's an "add" bar button
on the navigation bar. And a table view where you can tap and enter the
detail view. The problem is when the user tap the bar button item and the
table view cell at the same time, it doesn't work well.
The code here:
Action for right bar button item:
- (IBAction)saveAction: (id)sender;
{
...
...
[NSThread detachNewThreadSelector:@selector(saveTheData) toTarget:self
withObject:nil];
}
- (void)saveTheData
{
//some save action...
[self.navigationController popToRootViewControllerAnimated: YES];
//when complete, pop to the root
}
Action for table view's delegate method
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DetailViewController *controller = [[DetailViewController alloc]init];
[self.navigationController pushViewController: controller animated:
YES];
[controller release];
}
When using UIButton, we can set the exclusive touch property to avoid
tapping the two buttons at the same time. But what should I do for the table
view and the bar button item.
Thanks a lot!
Best regards
Leon
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden