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 671645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:23:48+00:00 2026-05-14T00:23:48+00:00

I have a UIAlert that pops up 3 times every time it is called.

  • 0

I have a UIAlert that pops up 3 times every time it is called. It appears and then disappears before I can click on it. Could it be that the viewDidLoad itself is being called 3 times?

I implemented an UIAlert in the viewDidLoad of my app:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:alertMessage  delegate:self cancelButtonTitle:ok otherButtonTitles:nil];

This is the viewDidLoad in the rootViewController, that manages the views:

- (void)viewDidLoad {
    Kundenkarte *kartenAnsicht = [[Kundenkarte alloc]
                                                initWithNibName:@"Kundenkarte" bundle:nil];
    kartenAnsicht.rootViewController = self;
    kartenAnsicht.viewDidLoad;
    self.map = kartenAnsicht;


    [self.view addSubview:kartenAnsicht.view];


    [kartenAnsicht release];
//  [super viewDidLoad];

}

The viewDidLoad that evokes the UIAlert is in the kartenAnsicht view controller.

I hope someone can help me because I’m out of ideas.

  • 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-05-14T00:23:49+00:00Added an answer on May 14, 2026 at 12:23 am

    First of all, you should never put any type of display in viewDidLoad. That method is intended for behind the scenes configuration after the view is first read from nib. There is no certainty that it will be called every time the view displays because after the first time it loads, the view maybe held in memory and not reloaded from nib.

    Instead, put the call to evoke the NSAlert in viewWillDisplay or viewDidDisplay. This will display the alert each time the view appears.

    I doubt that viewDidLoad is called three times but to check for that just put an NSLog in the method to see how many times it is called.

    When you say that:

    i implemented an NSAlert in the
    viewDidLoad() of my app:

    … what does that mean? What object exactly has the method? If it is the application delegate, this will not work because the application delegate protocol does not respond to viewDidLoad. It has to be in a UIViewController.

    Edit01:

    See this post that had the same problem: UIAlertView Pops Up Three Times per Call Instead of Just Once

    Short answer: You kill the alert by releasing it. Either retain it as a property of the view controller or better yet, display the alert with runModal instead of show and capture the button number returned immediately.

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

Sidebar

Related Questions

I have a UIAlert appear just before the UINavigationController pops a view controller off
I am working on an app where a UIAlert pops up the first time
I have a UIPicker that triggers a UIAlert when a row is selected. I'm
I don't like the UIAlert from cocoa and want to have some notification that
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have a n-tire web application and search often times out after 30 secs. How
I want to see in a moment my UIAlert above my UIActivityIndicatorView, i have
I have a geo collection that contains items like: [state name] [city], [state] [country]
I have defined my dialog on the page load. I can see the dialog
I have an HTML link that opens a jQuery modal dialog which contains an

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.