Create new class Singleton with parent NSObject
@interface Singleton : NSObject
@property (nonatomic, strong) NSString *stringParams1;
@property (nonatomic, strong) NSString *stringParams1;
+ (Singleton *)sharedInstance;
@end
Singleton.m:
@implementation STGameHelper
+ (Singleton *)sharedInstance
{
static dispatch_once_t once;
static id sharedInstance;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
@end
So in the view controller 1 and 2 just access this singleton:
Singleton *s = [Singleton sharedInstance];
s.stringParams1 = textField1.text;
s.stringParams2 = textField12.text;
In the view controller 3 you will have the same instance of singleton. Access it in viewDidLoad for example:
Singleton *s = [Singleton sharedInstance];
textField1On3rdViewcontroller.text = s.stringParams1;
textField2On3rdViewcontroller.text = s.stringParams2;
Read more about singleton here: link
As you are beginner I recommend you using singleton instead of core data right now, but if you need to store the data after they were entered I will suggest you read some tutorial how to work with core data because it is very powerful thing and it will make you life easiest. But for now it's enough to have singleton if you need to store data after app will be closed for example.