I have UITextField in secondViewController and a button in same view.
I want to get that UITextField text as a string to firstViewController.
Here my code.
SecondViewController.m
-(void)backToFirstView
{
NSString *str=disTxtFld.text;
FirstView *firstView=[[FirstView alloc]init];
firstView.discountStr=str;
[self.navigationController popViewControllerAnimated:YES];
}
FirstViewController.h
@property (nonatomic,strong) NSString *disStr;
FirstViewController.m
@synthesize disStr;
-(void)viewWillAppear:(BOOL)animated
{
NSLog(@"discount:%@",disStr);
}
When i`am trying to print that string in first view..it showing null value..
any suggestions...