I was wondering how I can pass an object from a view controller to another view controller in a tab application?
So far I have done this:
I created the 'Tab Application' in Xcode; I then get two view controllers (FirstViewController and SecondViewController). The FirstViewController has two textfields:
todoName
andtodoDetail
, and in the SecondViewController I would like to have a table view list of todos.Then I create a new class called
Todo
with two simple string properties (todoName
andtodoDetail
) and with a constructor to fill in those properties.The user would add input to the two text fields in FirstViewController, which then instantiates a Todo object, and then I put the todo object in an array.
What I want to do is to pass this array to the SecondViewController so I can fill up the table view. How can I do this?