didSelectRowAtIndexPath being called after viewDidLoad of the called view
- by Serguei Fedorov
I am trying to pass variables over to the new view. I have the following code:
appDelegate *dataCenter = (AppDelegate*)[[UIApplication sharedApplication] delegate];
dataCenter.myVariable = [array objectAtIndex:indexPath.row];
in the
didSelectRowAtIndexPath
of the calling view. However, the issue that I have is that this variable is empty in the vewDidLoad function of the next view, simply because it fired off BEFORE the didSelectRowAtIndexPath of the calling view. I am using storyboard to link the views together. Both are UITableView.
If I hit back and then reselect the table element it is then set, granted that by the time I hit back and then selected again, the variable got set. Is there any way to for the order of execution? I really don't want to do UI view switching on the back end.
Any help is greatly appreciated!