How can I pass an NSString from one View Controller to another?
问题 I made a very simple storyboard based project with two View Controllers. I want to simply access a string declared in VC1 from VC2. The second VC should then display the text in a textfield upon the press of a button. I do not want to use delegation , a separate class for global data or global variables and Extern . Instead, I read that it was easy to achieve variable sharing using a reference to one VC in the other. For my code shown below, XCode didn't complain, however my problem is this: