Sorry, I don't have time right now to fully respond, but first thing's first: 
UIKit is generally not thread-safe, so you should not invoke user interface 
actions (like popping a nav controller) on a secondary thread. 

This is a situation where GCD can make your life a lot simpler (with nested 
dispatch_async() calls)...

(Sent from my iPhone.)

--
Conrad Shultz
www.synthetiqsolutions.com

On Aug 29, 2011, at 19:34, Leon Qiao <leon.qiao....@gmail.com> wrote:

> 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 (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/conrad%40synthetiqsolutions.com
> 
> This email sent to con...@synthetiqsolutions.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to