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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:15:55+00:00 2026-06-11T11:15:55+00:00

I am working on a universal application.I am using self.window.rootViewController = self.SecondViewController to load

  • 0

I am working on a universal application.I am using

self.window.rootViewController = self.SecondViewController

to load viewcontroller class in the AppDelegate method.
This line of code is working fine for ios versions 4 and later but when i run it on my ios 3.1.3 it crashes.

So I replaced that code with [self.window addSubview:[SecondViewController view]] and it works fine but initially the view moves up(As in the screen shot) when we load the app for the first time.

So kindly help me overcome this issue
thank you enter image description here

  • 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-11T11:15:56+00:00Added an answer on June 11, 2026 at 11:15 am

    The rootViewController property was introduced with iOS 4.0, that is the reason for the crash in iOS 3.1.3.

    If you use [self.window addSubview:[SecondViewController view]] then it can happen that the view controllers view is not adjusted for the status bar. See Offset on UIWindow addSubview for a good explanation.

    The solution is to assign the view’s frame, in your case

    self.SecondViewController.view.frame = [UIScreen mainScreen].applicationFrame;
    

    before adding it as subview.

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

Sidebar

Related Questions

I'm working on an iPhone application (not an universal one). When I launch this
I'm working on a universal iPhone/iPad application. I'm using MonoTouch, but I can take
I am working on xcode project intended to make a universal app.With the window
This isn't working in IE (although it does work in FFX). Why? Using HTML
I am working on a universal app, I used UISplitViewController in doing iPad application.
I am working on a Universal iOS Application on Xcode 4 . It's my
I am working with a file uploaded using Django's forms.FileField . This returns an
I am working on a universal application where I am stuck at one point.
I am working in iPhone application, Using Xcode 4.3.2 tool to develop it, Using
I am working on an iphone application using openCV framework. Everything was working fine.

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.