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

  • Home
  • SEARCH
  • 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 6255043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:17:31+00:00 2026-05-24T14:17:31+00:00

I have my application working great on my iOS 4.3.3 iPhone 3GS. When I

  • 0

I have my application working great on my iOS 4.3.3 iPhone 3GS. When I test the app on a 3.1.3 iPhone 3G, the program crashes right after the splash image is shown. The debugger points to the last command of my root view controller’s awakeFromNib:

- (void)awakeFromNib
{
    NSLog(@"awakeFromNib");
    NSLog(@"applicationWillEnterForeground listened");
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(applicationWillEnterForeground:)
                                                 name:UIApplicationWillEnterForegroundNotification
                                               object: nil];
}

.

2011-08-09 15:56:24.585 AppName[4401:207] awakeFromNib
2011-08-09 15:56:24.602 AppName[4401:207] applicationWillEnterForeground listened
Program received signal:  “EXC_BAD_ACCESS”.

Is there something special about iOS 3’s awaking/sleeping that I should know that would help me work around this problem?

  • 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-24T14:17:32+00:00Added an answer on May 24, 2026 at 2:17 pm

    The problem is that the identifier UIApplicationWillEnterForegroundNotification is pointing to an externally defined string that only exists on iOS 4 or later. On iOS 3 and earlier, it will evaluate to nil; thus, you are passing in nil for a notification name, which is why adding the observer is crashing.

    You can fix this in two ways. You could directly use the string value of the notification’s name in your code:

    [[NSNotificationCenter defaultCenter]
     addObserver:self 
     selector:@selector(applicationWillEnterForeground:)
     name:@"UIApplicationWillEnterForeground" // might not be correct
     object:nil];
    

    I’m not sure if that’s what it is, you’ll have to check the docs or use NSLog to be exactly sure of it.

    A better option is to check the value of the identifier first, and only add a listener if it is supported:

    if (UIApplicationWillEnterForegroundNotification) {
        [[NSNotificationCenter defaultCenter]
         addObserver:self 
         selector:@selector(applicationWillEnterForeground:)
         name:UIApplicationWillEnterForegroundNotification
         object:nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a message inspector in my WPF/WCF 4.0 application that is working great
I have a ASP.NET MVC 4 application with Web API. It's working great. But
I have a struts2 application which uses the struts2-rest-plugin v.2.2.3. Everything is working great
I'm building my first application that requires a calendar. I have it working great
I have a web application that is working great while running form VS, but
I have a Phonegap/jQuery application which is working great, however in one area the
I have an application, which works with Resources for translation. This is working great.
I have an android application that was working great but 2 days ago things
I have an app where the Facebook Login was working great as of yesterday.
I have a Single Sign-on solution which is working great in our test environment.

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.