can i use to pass a data with 'navigation controller back button' in xcode

那年仲夏 提交于 2019-12-27 05:07:52

问题


i have 2 view controller and a navigation controller . we shall say main for 1 and detail for 2. when i push button in main, detail opens and main opens with back button

well, i want to change a label text or a string in main view controller when i clicked a button and back button on detail view controller.

how can i make this?

if([segue.identifier isEqualToString:@"deneme"])
{
MainViewController *main=[segue destinationViewController];
main.detay=@"denme";

}

i tried prepareForSegue and function that i wrote but i couldn't.


回答1:


"koediseps"

i have written a demo for passing data for you, download it and check it. if you found any problem , ask me.

here is the link for data passing with delegate demo

some other useful link simple-delegate-tutorial-for-ios-development

passing-data-using-delegates-between-viewcontrollers



来源:https://stackoverflow.com/questions/23791199/can-i-use-to-pass-a-data-with-navigation-controller-back-button-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!