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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:09:52+00:00 2026-05-16T15:09:52+00:00

I am trying to create a 1-2 second splashcreen for my application using a

  • 0

I am trying to create a 1-2 second splashcreen for my application using a modal view controller however when i try to dismiss the view my application crashes with a bad access error. So in my application delegate i have:

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
 //create window and show it
 window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
 window.backgroundColor = [UIColor greenColor];
 [window makeKeyAndVisible];


 //create the main view controller and add its view to the window 
 mainViewCtrl = [MainViewController alloc];
 [window addSubview:mainViewCtrl.view];


 //show splash screen
 UIImage *image      = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"default.png" ofType:nil]];
 splashViewCtrl  = [[UIViewController alloc] init];
 splashViewCtrl.view = [[UIImageView alloc] initWithImage:image];
 [mainViewCtrl presentModalViewController:splashViewCtrl animated:NO];

//setup callback to dismiss
[self performSelector:@selector(hideSplash) withObject:nil afterDelay:2.0];

return(true);
}

//hide splash screen callback
- (void)hideSplash {
 [[self mainViewCtrl] dismissModalViewControllerAnimated:YES];
}

And this all works perfectly fine except when the hideSplash is called after 2 seconds the application crashes with a EXC_BAD_ACCESS. If i comment out the perform selector line and call the hidesplash immediately after like so:

[mainViewCtrl presentModalViewController:splashViewCtrl animated:NO];

[self hideSplash];

The modal view is properly dismissed. I’m fairly sure this is a memory management problem but i’m not sure exacty what i’m doing wrong here. Does anyone have any ideas of what this could be or how to properly debug this so i can delay the dismissal?

Thanks

  • 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-16T15:09:53+00:00Added an answer on May 16, 2026 at 3:09 pm

    This looks weird:

    mainViewCtrl = [MainViewController alloc];
    

    Try adding the initialisation call to it.

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

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This isn't so much an "algorithm" as a "trick" but… May 16, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer Rspec is widely used in rails, and in conjunction with… May 16, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer I haven't used it with raw files or xml layout… May 16, 2026 at 5:10 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to create a chain of function calls using two objects. I've added
I am trying to create a button using CSS Gradients plus a icon that
I am trying to create a map using two arrays. Here is the code:
I'm trying to create a Comments section in my wiki. There's one solution on
I am trying to create a form in ASP.NET MVC2 RC 2 that is
I am getting an error when trying to create a relationship within two tables
I am trying create a new css for shaping my detailsview. But i couldn't
I'm coding in Objective-C for the iPhone and I am trying create an array
I trying to create an animation with JQuery that scrolls 1 word in a
I trying to create some dirs like this: @mkdir(photos/$cat/$sku, 0777, true) it creates the

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.