In Xcode (iPhone application) I have created a number of buttons programatically like this:

```
- (void)viewDidLoad
{
    [super viewDidLoad];

    // By Road Button
    byRoadButton = [UIButton buttonWithType:UIButtonTypeCustom];
    byRoadButton.tag = 3;
    byRoadButton.frame = CGRectMake(20, 246, 280.f, 40.f);
    UIImage *roadButton = [UIImage imageNamed:@"gettingHereByRoadButton.png"];
    [byRoadButton setBackgroundImage:roadButton forState:UIControlStateNormal];
    [self.view addSubview:byRoadButton];
    [byRoadButton addTarget:self action:@selector(byRoadButtonClicked) forControlEvents:UIControlEventTouchUpInside];
}

```

Then I check which button is pushed in action:@selector, and call performSegueWithIdentifier. The NSLog shows the correct button tag here as a check. 

```
- (void) byRoadButtonClicked
{
    NSLog(@"Button Pushed Tag Number: %d", byRoadButton.tag);
    [self performSegueWithIdentifier:@"gettingHereSegue" sender:self];
}

```

But how do I pass the button tag to prepareForSegue? The idea is to pass this tag to prepareForSegue, and based on the tag number, I pass the information associated with that button to the next ViewController?

I have tried:

```
[self performSegueWithIdentifier:@"gettingHereSegue" sender:byRoadButton.tag];

```

But get an error saying Im trying to pass an int instead of an id.

In my prepareForSegue I have the following:

```
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // ThIS IS WHAT I WANT TO DO - PSEUDO CODE
    //int tagNumber = sender;
    //if (tagNumber == 3)
    //{
          //Set relevant content of Object here
    //}

    //THIS IS WHAT I CURRENTLY HAVE - NO CHECK FOR TAG
    GettingHereContent *gettingHereContent = [[GettingHereContent alloc] init];
    gettingHereContent.content = @"This is my custom content based on this buttons click";

    GettingHereViewController *vc = (GettingHereViewController *)segue.destinationViewController;
    vc.gettingHere = gettingHereContent;   
}

```

Or can anyone suggest a solution or maybe a better way to do this please?