I am making an App in which i need to pass data between views using button click in Objective-C.
I have created, ViewController.m to pass and DetailController.m to get...
ViewController.m:
- (IBAction)btnSubmit:(id)sender {
NSString *name = [txtName text];
DetailController *view2 = [[[DetailController alloc]
initWithNibName:nil bundle:nil] autorelease];
[self presentViewController:view2 animated:NO completion:NULL];
}
DetailController.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
lblResult.text = [self.detailItem description];
}
I am not getting the reason why i am not able to pass name value to another view