Actually, there are many solutions to your question.
Pass data using segues.
Pass data using properties declared in the app delegate file.
Now, both these things have different uses depending upon your need. You should learn these things in details. Explaining them here is not a good idea.
http://www.appcoda.com/storyboards-ios-tutorial-pass-data-between-view-controller-with-segue/
http://www.cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html
These links should help you understand.
Solution to your problem:
In AppDelegate.h (application Delegate file) file, declare a property.
@property NSString *name;
Synthesize it in AppDelegate.m (application Delegate file).
@synthesize name;
Now, in ViewController1.h declare AppDelegate object.
AppDelegate *delegate;
In viewDidLoad of ViewController1.m type this:
delegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
Now, in the button press event in ViewController, add this.
//get data from textField and assign it to delegate.name
//delegate.name = textField.text;
In viewController2 create a delegate object and access the value.
//Declare a delegate object in viewController2 and create the delegate object in viewDidLoad of viewController2
//Use delegate.name
//NSLog(@"%@",delegate.name);
I hope it helps.