Reputation: 3240
I got an app with a storyboard and one window in .xib. From the storyboard to the .xib i move in that way:
ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:detailViewController animated:nil];
How can i move back from the .xib to the storyboard?
And one more question. Can i send some information when move to the .xib from storyboard? Like i do it throught segues in prepareForSegue
method
UPD I got answer about closing .xib. Need answer about sending information.
Upvotes: 4
Views: 3062
Reputation: 3152
you can get back to your storyboard by simply dismissing the modal view controller. Like this:
- (IBAction)backPressed:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
You should put this method in your ShowDreamNIBController. As for the second question, you can send back information to the view controller that presented the modal view controller by getting reference to it using delegation.
EDIT: To "send information to the XIB" do you mean that you want to set information to the view controller that you want to present? If yes, than use this when you present the modal controller:
ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc]initWithNibName:nil bundle:nil];
[detailViewController setSomething: something];
[detailViewController setAnotherThing: anotherThing];
[self presentModalViewController:detailViewController animated:nil];
I hope this helps.
Upvotes: 3