本文介绍了如何使用popToViewController发送字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用navigationcontroller。我有(Root,A,B,C,D)课程。我想通过popToViewController将字符串测试值类 D 添加到类 A 。
谢谢
解决方案
维护并且根控制器始终位于 0
。
MyAController * myController =(MyAController *)[self.navigationController.viewControllers objectAtIndex:0];
myController.myText = @My String;
[self.navigationController popToViewController:myController animated:YES];
I am using navigationcontroller. i have (Root,A,B,C,D) class. i want to sand a string test value Class D to Class A via popToViewController.
Please give me suggestion.
Thanks
解决方案
UINavigationController
maintain the list of all pushed controller in viewControllers
and the root controller always reside at 0
.
MyAController *myController = (MyAController *)[self.navigationController.viewControllers objectAtIndex:0];
myController.myText = @"My String" ;
[self.navigationController popToViewController:myController animated:YES];
这篇关于如何使用popToViewController发送字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!