Recently I am stuck in a problem so that I cannot move on to the next coding part. There are two view controllers(let's say the first.m and second.m) and I would like to pass parameter data from one to another view controller without using storyboard. But the tricky part for me is the second view controller was already initiated in the AppDelegate.m file.
I can pass data if I have initiated the second view controller in the first view controller with some importing header file, for example..
@import "Second.h"
Second *secondView = [[Second alloc] initWithNibName:@"SecondNib" bundle:nil];
secondView.someStringValue = @"passThisString";
However, this coding makes a new second view controller, which is not what I want. I found there is a something like
myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];
to connect to the AppDelegate.m file. But after a few days struggling with this my brain is getting blackout. Please give me any advice.. Is there a way to pass data to existing view controller without using storyboard? or any way through AppDelegate to Second view controller. Any help will be appreciated