• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIBarButtonItem exclusive touch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIBarButtonItem exclusive touch


  • Subject: Re: UIBarButtonItem exclusive touch
  • From: Conrad Shultz <email@hidden>
  • Date: Mon, 29 Aug 2011 23:16:15 -0700

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 <email@hidden> 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 (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
_______________________________________________

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

  • Follow-Ups:
    • Re: UIBarButtonItem exclusive touch
      • From: Leon Qiao <email@hidden>
References: 
 >UIBarButtonItem exclusive touch (From: Leon Qiao <email@hidden>)

  • Prev by Date: drag and drop not working between windows on 10.7
  • Next by Date: Re: UIBarButtonItem exclusive touch
  • Previous by thread: UIBarButtonItem exclusive touch
  • Next by thread: Re: UIBarButtonItem exclusive touch
  • Index(es):
    • Date
    • Thread