Hi the solution really worked
here is what i did
in secondViewController.h I declared a string as property
Code:
@interface secondViewController : UIViewController {
IBOutlet UILabel *labelName;
NSString *textValue;
}
@property (nonatomic,retain) UILabel *labelName;
@property (nonatomic,retain) NSString *textValue;
in secondViewController.m
Code:
-(void)viewWillAppear:(BOOL)animated{
labelName.text=textValue;
}
in firstViewController.m
Code:
if(self.secondViewController==nil){
SecondController *view2=[[SecondViewController alloc] initWithNibName:@"SecondView" bundle:[NSBundle mainBundle]];
self.secondViewController=view2;
[view2 release];
}
secondViewController.textValue =txtField.text;
[self.navigationController pushViewController:secondViewController animated:YES];
Thanks for the help