Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9167551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:25:07+00:00 2026-06-17T15:25:07+00:00

I’m having an issue when someone taps the rightBarButtonItem on the navigation bar and

  • 0

I’m having an issue when someone taps the rightBarButtonItem on the navigation bar and taps it again quickly that the program crashes. It’s understandable that is crashes because the new view hasn’t finished loading yet and the button is still visible to tap again so it will attempt to push the view again crashing the program. I’ve tried a couple of methods to try and prevent this and my current implementation somewhat works, but I know there is a better solution, perhaps a solution built into the framwork?

- (void) loadView
{
    [super loadView];

    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
                                               initWithTitle:@"Members" 
                                               style:UIBarButtonItemStylePlain 
                                               target:self 
                                               action:@selector(showRoster)] autorelease];
}


-(void) showRoster {
    if (seconds + 3 < [[NSDate date] timeIntervalSince1970]) { //This is where I am trying to prevent the button from being activated twice.
        seconds = [[NSDate date] timeIntervalSince1970];

        vcRoster = [[RosterDataViewController alloc] init];
        vcRoster.rosterDataModel.group_id = self.tweetsByGroupIdModel.group_id;
        [self.navigationController pushViewController:vcRoster animated:YES];
    }

}

I’ve also tried this, but it’s not doing what I am thinking it should be doing.

if (!self.navigationController.isBeingPresented)

I’ve tried solving the problem and Googling my way to an answer, but I have yet to find a good solution to this problem. I know the above is not a good way to do things, I’m open to suggestions for any improvements at all as I am extremely new to the IOS world. Thanks in advance for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:25:08+00:00Added an answer on June 17, 2026 at 3:25 pm

    Try disabling the button as soon as the action method is run:

    -(void) showRoster:(UIButton*)sender {
      sender.enabled = NO;
      ...
    }
    

    You can enable it later, to make it responsive again. How you can best do that depends on the view you are showing: if it is full screen, you might simply re-enable the button in viewDidAppear: (i.e., after the view has disappeared and your button is visible again).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.