well this is one lengthy answer. But lets see:
First lets name your segues. For that, lets go the storyboard and do click on one of the segue:
Then you can set the name of the segue on the left panel:

Once this is done, do the same for the second segue.
So now we can identify which segue will be called when you click on the button.
Lets go TargetViewController.h and declare the following property:
@property(strong, nonatomic) NSString * urlString;
Once this is done, lets go to ViewController.m and declare the following method:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
TargetViewController * target = segue.destinationViewController;
if ([segue.identifier isEqualToString:@"GoogleSegueIdentifier"]) {
target.urlString = @"google";
} else if ([segue.identifier isEqualToString:@"YahooSegueIdentifier"]) {
target.urlString = @"yahoo";
}
}
This method will be called, whenever a segue is inisiated on your viewcontroller. So here you can check which segue is called, by referencing the identifier set on your storyboard.
Because you declared this "urlString" variable on TargetViewController, therefore you can set its value here.
After this all you need to do is to add the following in your viewDidLoad @ TargetViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
if([self.urlString isEqualToString:@"google"]){
//open the google URL
} else {
//open yahoo URL
}
}
At the end let me tell you, this is not the best practice what you can follow to get stuff like this done, but this is what you have asked for, so there you go. Hope it helps.