Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:23:43+00:00 2026-05-28T08:23:43+00:00

In my application I have 2 separate ways to get to the same UIViewController,

  • 0

In my application I have 2 separate ways to get to the same UIViewController, on way is to go through 2 parent ViewControllers created using the storyboard and this way works perfectly just passing and id through each segue transition.

The other way (Which is what I need help with) goes directly from a button pressed on the RootViewController, it also just passes the id to a customly defined object called Event. The code for each transition is below:

From the segue:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 
{
    NSIndexPath *path = [self.tableView indexPathForSelectedRow];
    Event *event = [nEventList objectAtIndex:path.row];
    EventInfo *eventInfo = segue.destinationViewController; //Create new ViewController
    eventInfo.eventID = event.id;
}

From the button:

- (void)FeaturedPressedAction:(id)sender
{
    UIButton *button = (UIButton *)sender;
    int tag = button.tag;
    EventInfo *eventInfo = [[EventInfo alloc] init]; //Create new ViewController
    eventInfo.eventID = @"1"; //There is an event with id '1'
    [self.navigationController pushViewController:eventInfo animated:YES];
}

And the code to set up the ViewController:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    UIImage *image = [UIImage imageNamed:@"title.png"];
    self.navigationItem.titleView = [[UIImageView alloc] initWithImage:image];

    SingletonClass* myapp = [SingletonClass sharedInstance];
    events = [myapp getEvents];

    // Loop to filter out the events that Do not have this ID
    Event *event;
    BOOL found = false;
    for (int i = 0; i < [events count]; i++) {
        if(!found){
            event = [events objectAtIndex:i];
            if([event.id isEqualToString: eventID]){
                found = true;
                NSLog(@"Found the event with title %@", event.title);
            }
        }
    }

    self.eventTitle.text = event.title;
    self.eventLocation.text = event.location;
    self.eventDate.text = event.date;
    self.eventTime.text = @"22:00";
    self.eventDescription.text = event.details; 
}

It finds the event fine as I can see with the NSLog’s left in there, just none of the view loads when coming from the button press. Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:23:44+00:00Added an answer on May 28, 2026 at 8:23 am

    Rather than alloc your EventInfo*, you should instantiate it from your storyboard instead.

    So in your FeaturedPressedAction replace the initialisation line with:

    EventInfo *eventInfo = [self.storyboard instantiateViewControllerWithIdentifier:@"..."];
    

    And make sure you identify the ViewController in Interface Builder with the same identifier. Replace … with something meaningful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP.NET application I have separate projects for the Data, Business and UI
I have web application which we deployed in a production . We have separate
We have an application which we licence to separate companies. The app is customised
I have an application in which I am running a separate thread. Dim thread
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application
I have a rails application where each user has a separate database. (taking Joel
I have an ASP.NET MVC application with a separate project added for tests. I
I have a web application that is becoming rather large. I want to separate
I have a main application, and a bunch of sub-applications (they are separate apps,
We have a PeopleSoft installation and I am building a separate web application that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.