views:

37

answers:

1

When I am try to present a UIViewController with a NavigationController from a UiViewController, the X-Code is crashed, I don't know why because I do it like all other views in my App, but just only this one has problem, I tried to debug but I didn't find out the cause, X-Code crashed right at "presentModelView:" method, and a funny thing that when I trying to push that view to NavigationController instead of present model view, everything is ok. Below is my present model view code and stack:

Code:

LoginViewController *viewController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
    viewController.realmsList = realmsArray;
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];

    navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:navController animated:YES];
    [viewController release];
    [navController release];

Error Stack: Program received signal: “EXC_BAD_ACCESS”. Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib") warning: Unable to restore previously selected frame. No memory available to program now: unsafe to call malloc warning: check_safe_call: could not restore current frame

warning: Unable to restore previously selected frame. kill quit

The Debugger has exited with status 0.(gdb)

A: 

The problem is resolved, my bad!

The view which should be loaded at "presentModelViewController" method contain a method to just allow this view shown in portrait mode, instead of get the interfaceOrientation from input parameter, I got it by self.interfaceOrientation, but in this case, that view is not loaded yet. So it's cause a dead loop. :(

Son Nguyen