呈现的视图在 iPhone 中不起作用

发布于 2024-12-26 09:45:41 字数 319 浏览 4 评论 0原文

我正在尝试通过单击 Facebook 应用程序中的按钮从一个页面导航到另一个页面。
我用于

registerUser=[[RegisterPage alloc]initWithNibName:@"RegisterPage" bundle:nil];
[self presentModalViewController :registerUser animated:YES];

在收到 facebook 的回复后呈现下一个视图。
但它没有显示下一个视图。它在我曾经提出其他观点的所有其他地方都运行良好。

有人对这个问题有想法吗?

I am trying to navigate from one page to another on a button click in a facebook appliaction.
I am using

registerUser=[[RegisterPage alloc]initWithNibName:@"RegisterPage" bundle:nil];
[self presentModalViewController :registerUser animated:YES];

for presenting the next view after getting response from facebook.
But it is not showing the next view. It works fine in all other places where I used to present other views.

Anyone have idea about this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你怎么敢 2025-01-02 09:45:41

这里的‘自我’到底是什么?它是一个视图控制器吗?或者只是一个 UIView?
我认为这只有在 self 是视图控制器或其某个子类时才有效。

What exactly is 'self' here? Is it a viewcontroller? Or just a UIView?
I think this'll only work if self is a viewcontroller or some subclass of it.

她比我温柔 2025-01-02 09:45:41

我呈现视图控制器的代码有点像你的(没有笔尖):

ViewController *controller = [[ViewController alloc] initWithNibName:nil bundle:nil];
[controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:controller animated:YES];
[controller release];

呈现导航控制器就像这样(没有笔尖):

ViewController *controller = [[ViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navController = [[UINavigationController alloc]       initWithRootViewController:controller];
[navController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:navController animated:YES];
[navController release];
[controller release];

有时简单地复制某人的代码会有所帮助。

My code to present a view controller is somewhat like yours (without a nib):

ViewController *controller = [[ViewController alloc] initWithNibName:nil bundle:nil];
[controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:controller animated:YES];
[controller release];

And to present a navigation controller it's like this (without a nib):

ViewController *controller = [[ViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navController = [[UINavigationController alloc]       initWithRootViewController:controller];
[navController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:navController animated:YES];
[navController release];
[controller release];

Sometimes simply copying someones code helps.

俏︾媚 2025-01-02 09:45:41

感谢大家的回复。经过长时间的战斗,我已经解决了这个问题。我只是在发送下一个视图之前关闭了该视图,并将dismissmodalviewcontrollerAnimated设置为NO。[self解雇ModalViewControllerAnimated:NO];
nextview = [[LoginPage alloc]initWithNibName:@"LoginPage"bundle:nil];
[selfpresentModalViewController:nextviewanimated:YES];
希望这对像我这样的人有帮助

thanks for everyones reply.i have solved it after a long fight.i just dismissed the view before pesenting the next view and set dismissmodalviewcontrollerAnimated to NO.[self dismissModalViewControllerAnimated:NO];
nextview = [[LoginPage alloc]initWithNibName:@"LoginPage" bundle:nil];
[self presentModalViewController: nextview animated:YES];
hope this help someone like me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文