Take this in .h file in ParentViewController
NSString *strABC;
Make below function in ParentViewController
-(void)setString:(NSString *)strEntered{
strABC=strEntered;
}
Now In Post view controller do like this:
ParentViewController *objSecond = [[ParentViewController] initwithNibName:@"parentView.xib" bundle:nil];
[objSecond setString:@"Comment Controller"];
[self.navigationController pushViewController:objSecond animated:YES];
[objSecond release];
Now, In secondViewController viewWillAppear Method write this.
-(void)viewWillAppear:(BOOL)animated{
lblUserInput.text = strABC;
}
Please check spelling mistakes as I hand written this. Hope this help.
If you are not using navigationContoller then you can do something like this.
SecondViewControler *objSecond = [[SecondViewController] initwithNibName:@"secondview.xib" bundle:nil];
[objSecond setUserInput:txtUserInput.text];
[objSecond viewWillAppear:YES];
[self.view addSubview:objSecond];
[objSecond release];