在利用stroyboard开发,有时候利用
TestViewController *control=[[TestViewController alloc]init];
[self presentModalViewController:control animated:YES];
来进行跳转的时候,有时候跳过去是黑屏,但是传输过去的数据可以通过log打印出来,很奇怪,后来研究了一下,可能跳过去的只是TestViewController,里面的逻辑实现了,但是界面是由storyboard实现的,所以界面没有显现出来,后来改为别的方法就可以了:
TestViewController *control=[self.stroyboard instantiateViewControllerWithIdentifier:@"id"];
[self presentModalViewController:control animated:YES];
这样跳过去就不是黑屏了,数据也能正常传输了;其中@“id”为TestViewController在storyboard中的id
本文探讨了在使用Storyboard进行iOS应用开发时遇到的一个特殊问题:通过特定方式调用视图控制器导致界面黑屏,而数据却能正常传递。文中详细介绍了问题的原因,并给出了解决方案。
4166

被折叠的 条评论
为什么被折叠?



