0

I'm new to Xcode and am trying to make a simple application where I enter a value hit a button and the value is passed to the next view and displayed. I am having trouble finding content on the internet on how to do this.

I created a Single View Application and another view controller, then connected them with a modal but cannot figure out how to pass values between the two.

Any pointers or good references would be awesome.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
MattAttack
  • 26
  • 3

1 Answers1

0

Please look at the link that Caleb shared but the general concept is... You create an ivar on the second view controller that you are passing to

Say for example you are passing an NSString called myName between controllers. Declare it in the second view controlller

Then from the first view controller before you show it do something like this:

my2ndViewController.myName = @"John Smith";
logixologist
  • 3,694
  • 4
  • 28
  • 46