I am using UITabBarController, It has three TabBarItem. All are drag and drop from XIB. Each tab has one view. Now how to sent NSString value from first TabBarItem View to second TabBarItem View. I am not able to send the value. Here is my code:
tableViewIns = [[TableViewController alloc]init];
tableViewIns.yearInputValue = yearTextField.text;
tableViewIns.principalInputValue = principalTextField.text;
tableViewIns.interestInputValue = interestTextField.text;
First tab is HomeViewController, the second tab is TableViewController. How to send value from one tab to another tab.
If you have properly synthesized all variables and still not getting result then try another way….
That is, define variables(in your case,there are 3)in AppDelegate….
propertyandsynthesizethem…NSString *year,*principal,*interest;Now, in Firstview, declare and initialize AppDelegate variable….like
then,
app.year = yearTextField.text;and define the rest like-wise…..Now in TableViewController, same, define AppDelegate and using object…get those values ….
and it is same for rest interest and principal…..
This is the best way to get values from one view to another….:)