Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone viewController

Tags:

iphone

I am creating an application in which I have to pass data from 16 UITextFields, store them in an array in form of a class object and display all the objects from that array in other viewController.

How can you pass data from one viewController to the another?

like image 579
Shabbir Panjesha Avatar asked Feb 27 '26 12:02

Shabbir Panjesha


1 Answers

Suppose you have two view controllers named viewController1 and viewController2. Have an instance variable textData of NSArray in viewcontroller2. Make sure you add @property and @synthesize to the variable. Allocate the array in the init method of viewController2 and you can pass the array from the first viewController to the second by

viewController2.textData = viewController1.textArray;
like image 70
visakh7 Avatar answered Mar 02 '26 02:03

visakh7