开发者

Xcode crash when presenting model view

开发者 https://www.devze.com 2023-01-18 09:43 出处:网络
When I am try to present a UIViewController with a NavigationController from a UiViewController, the Xcode is crashed, I don\'t know why because I do it like all other views in my App, but just only t

When I am try to present a UIViewController with a NavigationController from a UiViewController, the Xcode 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, Xcode 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] initWi开发者_如何转开发thRootViewController: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)


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. :(

0

精彩评论

暂无评论...
验证码 换一张
取 消