开发者

presentModalViewController not presenting new view

sigh The Friday before WWDC isn't a good time to be asking this, but it's worth a try.

I created a UIViewController-based project, and from the first VC I'm trying to load a second, via a button action method. I execute the following code:

SaveLocationViewController *saveLocationViewController = [[SaveLoc开发者_如何学运维ationViewController alloc] 
    initWithNibName:@"SaveLocationViewController" bundle:nil];
[self presentModalViewController:saveLocationViewController animated:YES];

And... nothing visible happens. Via breakpoints I can see that both viewDidLoad and viewWillAppear are being called in saveLocationViewController, so it is getting loaded, but the view is not being displayed.

saveLocationViewController contains a call to initWithNibName, part of Apple's boilerplate code, but taking it out doesn't make any difference. The NIB appears to be correct, the view is hooked up, and I'm not getting any errors, the view just doesn't display. I still see the original view.

Any hints/suggestions?


  1. i saw your code and you have given your object name same as your class name with just change in the first character that's s so try to avoid such type of naming conventions, give object names like saveLocationObject or something like that.

  2. Also i would like you to see whether the action method is assigned to the buttons touch up inside method or not may be you have forgot to assign it because as far as your code is concerned its ok doesn't have any problem.

  3. Now if the problem still persists then in that case clean the build and then give it a try.

Do let me know if the issue still remains or is solved.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜