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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:26:55+00:00 2026-06-03T00:26:55+00:00

Using Xcode 4.2, my app runs in iOS 5.0 simulator. It runs on a

  • 0

Using Xcode 4.2, my app runs in iOS 5.0 simulator. It runs on a 3G iPhone with iOS 4.2.1. It does not run on an iPod with iOS 3.1.3.

This is boilerplate code I got from any number of tutorials, but on the iOS 3.1.3 device, after displaying my Default.png, this line fails:

self.window.rootViewController = self.viewController;

with ‘Unrecognized selector sent to instance’ in my ykAppDelegate.m here:

#import "ykAppDelegate.h"
#import "ykViewController.h"

@implementation ykAppDelegate

@synthesize window;
@synthesize viewController;

#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    // Override point for customization after application launch.

    // Set the view controller as the window's root view controller and display.
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    return YES;
}

With a more than cursory glance at the code, I notice viewController isn’t apparently instantiated (except for @synthesize); it’s just declared in my ykAppDelegate.h:

#import <UIKit/UIKit.h>

@class ykViewController;

@interface ykAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    ykViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet ykViewController *viewController;

@end

Is there a small tweak I can make so this will work in iOS 3.1?

  • 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-03T00:26:57+00:00Added an answer on June 3, 2026 at 12:26 am

    In pre-iOS5 operating systems UIWindow doesn’t have a property named ‘rootViewController’. An idiomatic solution is to simply add the view controller’s view as a subview to your application’s key window:

    [window addSubview:self.myViewController.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run my app in Xcode using the simulator it runs just file
I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation
I am using xcode 4.2 with storyboard to create an iphone app. When I
My app was crashing only when not running using XCode debugger. It was hard
I'm writing an iOS 5 app (in Xcode 4.3, using Storyboards and ARC) that
I am developing an iOS app using XCode 4.2 I have a UIImage variable
On my OpenGL ES 2.0 App - Using the iPhone simulator sometimes is dirt
I am developing an iphone app using xcode. I would like to automate the
I'm trying to create an iPhone app using xcode, and I want to know
I'm developing an iphone app using PhoneGap 1.2.0 with Snow Leopard, Xcode 4.2 &

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.