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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:44:04+00:00 2026-06-16T16:44:04+00:00

Edit: It seems this was a stupid mistake by me, i got a rotationChanged

  • 0

Edit: It seems this was a stupid mistake by me, i got a rotationChanged notification too early, before i could process it. That caused a chain reaction which caused a crash in some obscure location. Let me see how i can close/delete this question…

My app’s been working fine for a while, but i decided today to finally implement it ‘correctly’, that is: Use a view controller instead of manually adding a single view to the UIWindow. This went quite smooth for a while, untill i tried setting window.rootViewController to my view controller.

Somewhere after applicationDidFinishLaunchingWithOptions, it crashes with a bad access. There’s no useful stacktrace (it crashes in the assembly), and i can’t see it getting back into my code anywhere (i placed logs all over the place). Just adding the viewcontroller’s view to the main window works fine. This is the part of the code:

-(BOOL) application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ....
    self.window = [[UIWindow alloc] initWithFrame: [UIScreen mainScreen].bounds];
    self.viewController = [[MainViewController alloc]init];
    // if i uncomment this it crashes:
    // self.window.rootViewController = self.viewController;
    [self.window addSubview: viewController.view]; // Commented out if i use the rootViewController

    [self.window makeKeyAndVisible];
    NSLog(@"Did finish launching");
    return YES;
}

I’ve tried quite some debugging methods (stacktrace does not exist, stepping through the code manually takes forever, logs are not being called before the crash), but i can’t find the problem. It crashes in libobjc.A.dylib'objc_retain:, and the only other thing in the stacktrace is objc_storeStrong. It’s not a retain/release problem (at least not directly), since i’m using ARC. The final NSLog is called and it gets out of the didFinishLaunching if i step through manually.

I can get the app working without setting the root view controller, but the whole point of redoing this part was to do everything ‘proper’ (e.g. rotation has to be done relatively hackish without the root view controller).

so StackOverflow, please tell me you have some ideas! As this is driving me crazy :S

  • 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-16T16:44:05+00:00Added an answer on June 16, 2026 at 4:44 pm

    It seems this was a stupid mistake by me, i got a rotationChanged notification too early, before i could process it. That caused a chain reaction which caused a crash in some obscure location. Thanks for the help anyway!

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

Sidebar

Related Questions

This seems like such a simple question. I have several Edit boxes on my
Edit: [Solved] : It seems that the getTableCellRendererComponent of the CustomTableCellRenderer is called every
Which algorithms or data structures are used in auto-suggest features? It seems that edit-distance
I'm new to PHP and this question seems stupid. But I'm really confused with
This is probably something really stupid that I'm doing wrong, but I can't figure
EDIT: OH!!!!! it works!!! It seems that at one point it was fixed However
A painfully stupid question that I am almost too ashamed to ask. I have
[edit] So it seems my code works fine, another piece of code + tiredness
It seems it allows you to edit the content of an element, but what
EDIT : I completely re-wrote the question since it seems like I was not

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.