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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:31:32+00:00 2026-05-22T03:31:32+00:00

I don’t know what is wrong with that statement because I have exactly the

  • 0

I don’t know what is wrong with that statement because I have exactly the same code which I copied from another project of mine but it just keeps throwing EXC_BAD_ACCESS when everything looks fine. Can anybody pinpoint the problem? Much greatly appreciated as I have been on this error for hours, the same code keeps producing different results such as either bad access or I get a white screen.

Code Fragment:

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

NSLog(@"0");
UINavigationController * localNavigationController;

tabBarController = [[UITabBarController alloc] init];
NSMutableArray * localControllersArray = [[NSMutableArray alloc] initWithCapacity:4];

//ProductViewController
ProductViewController * productViewController;
productViewController = [[ProductViewController alloc] initWithTabBar];

localNavigationController = [[UINavigationController alloc] initWithRootViewController: productViewController];
[localControllersArray addObject:localNavigationController];
NSLog(@"1");
// memory statements
[localNavigationController release];
[productViewController release];


//Search View Controller
SearchViewController * searchViewController;
searchViewController = [[SearchViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController: searchViewController];
[localControllersArray addObject:localNavigationController];

// memory statements
[localControllersArray release];
[searchViewController release];
NSLog(@"2");
//Register View Controller
RegisterViewController * registerViewController;
registerViewController = [[RegisterViewController alloc] initWithTabBar];
localNavigationController  = [[UINavigationController alloc] initWithRootViewController:registerViewController];

[localControllersArray addObject:localNavigationController];
NSLog(@"3");
//memory management
[localControllersArray release];
[registerViewController release];

//About View Controller
AboutViewController * aboutViewController;
aboutViewController = [[AboutViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController: aboutViewController];
[localControllersArray addObject:localNavigationController];

//memory management
[localNavigationController release];
[aboutViewController release];
NSLog(@"4");
// Override point for customization after application launch.
tabBarController.viewControllers = localControllersArray;


[window addSubview:tabBarController.view];
// Override point for customization after application launch.
[self.window makeKeyAndVisible];
return YES;

The NSLog was to see where was the problem. The 3 doesn’t show up after [localNavigationController release].

I have attached the project.

http://www.mediafire.com/?eauye5s361cyej0

Thanks in advance.

  • 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-22T03:31:32+00:00Added an answer on May 22, 2026 at 3:31 am

    Use the static analyzer

    Really, use “Analyze” from the product menu, and it will pin-point the problem within a second.

    In

    [localControllersArray addObject:localNavigationController];
    

    you use the array that you released some lines before.

    Edit: And yes, posting code instead of upload a project is the way to go. Guess I just happen to have a nice day and downloaded.

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

Sidebar

Related Questions

Don't know if this has been asked before, so point me to another question
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't they both have to convert to machine code at some point to execute
Don't know what's wrong here, when I run the application it says Specified method
Don't know if it's I'm doing it wrong or if there's a bug (I
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't know if this has been answered before. Have custom routes to users. If
Don't exactly know what to search for: If i edit text in vim it
I don't have much PHP experience and I want to know how to best
Don't yell at me! i have seen many threads claiming that HTML cannot be

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.