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 9156887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:52:43+00:00 2026-06-17T12:52:43+00:00

I’m trying to link cells from an UITableViewController to UIViewController, but each cell has

  • 0

I’m trying to link cells from an UITableViewController to UIViewController, but each cell has to call a different UIViewController (so I imagine that I’ll have to create one link to each view controller) and I don’t know how to link them through storyboard.

This is what I have until now:

MainView.h

@interface MainView : UITableViewController <UITableViewDelegate, UITableViewDataSource>
{
    NSArray *tableData;
}
@property (nonatomic, retain) NSArray *tableData;
@end

MainView.m

- (void)viewDidLoad
{
    tableData = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", @"4", nil];
    [super viewDidLoad];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [tableData count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = nil;
    cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"];
    }
    cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UIViewController *anotherVC = nil;
    if (indexPath.section == 0) //here I've also tried to use switch, case 0, etc
    {
        if (indexPath.row == 0)
        {
            anotherVC = [[ViewForFirstRow alloc] init];
        }
    NSLog(@"anotherVC %@", anotherVC); // shows that anotherVC = ViewForFirstRow
    [anotherVC setModalPresentationStyle:UIModalPresentationFormSheet];
    [anotherVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [self.navigationController pushViewController:anotherVC animated:YES];
    }
}

@end

So, when first row is selected and I didn’t link UITableViewController to UIViewController (ViewForFirstRow), it shows a black screen.

If I link UITableViewController to ViewForFirstRow, it opens the view but without the effect I used in code [self.navigationController pushViewController:anotherVC animated:YES];, so it appears that it called the view due to the link and not because of the code [self.navigationController pushViewController:anotherVC animated:YES];

How can I call the view by code properly and what kind of link should I use in storyboard for that? Also, how can I link the UITableViewController to multiples UIViewController (ViewForFirstRow, ViewForSecondRow, ViewForThirdRow, etc).

Thanks!

  • 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-06-17T12:52:44+00:00Added an answer on June 17, 2026 at 12:52 pm

    In storyboard presenting another viewcontroller in modally manner then use this:

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
      Synergy *objSynergy = (Synergy *)[mainStoryboard instantiateViewControllerWithIdentifier:@"Synergy"];
     [self presentModalViewController:objSynergy animated:YES];
    

    Synergy is my controller name You can put here your controller name that you want to present.

    Make changes with your requirement. And for different viewcontroller open from different row

    Use this:

           if (indexPath.section==0) 
              {
                  if (indexPath.row ==0) 
                  {
                  }
              }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.