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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:53:42+00:00 2026-05-26T04:53:42+00:00

In my app, I need to load a different view for each cell in

  • 0

In my app, I need to load a different view for each cell in my table view when it is pressed. I have tried the code below, but my app fails when the cell is pressed.

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell.textLabel.text == @"Area")
    {
        ThirdViewController *tvController = [[ThirdViewController alloc] initWithNibName:@"ThirdView" bundle:nil];
        [self.navigationController pushViewController:tvController animated:YES];
    }
}

note that I have imported the ‘thirdviewcontroller.h’ file in the implementation file that code is in.

I am still getting used to coding with obj-c and Xcode, so please excuse me if I’ve tried something completely dumb/stupid. If you need more information, please let me know, so that my question is not closed.

I have also searched around, but nothing I have found seems to be helpful to me.

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-05-26T04:53:43+00:00Added an answer on May 26, 2026 at 4:53 am

    You might wanna add a modalviewcontroller based on what cell you clicked on.
    You know u have populated the tableview with an array, yes?

    Well do something like this:

    if ( [listOfItems objectAtIndex:indexPath.row] == someStatement)
    {
        YourVC = [[CustomViewController alloc] init];
    
        self.YourVc.dismissDelegate = self;
    
        UINavigationController *navController = [[UINavigationController alloc]
                                                   initWithRootViewController:self.YourVc];
    
        navController.modalPresentationStyle = UIModalPresentationFormSheet; //or any of the other presentationstyles.
    
        [self presentModalViewController:navController animated:YES];
    
        [self.addTableViewController release];
        [navController release];
    }
    

    This will make a new viewcontroller appear based on the selection you made.

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

Sidebar

Related Questions

In my app I have a need to load the same view from two
I have an app that uses several different user defaults that need to be
I need to implement threading to improve load time in a compact framework app.
In my app I need to draw a widget contents onto Bitmap. The code(pseudo)
I have a LAMP (PHP) web app which need to interface with programs on
I have an app which uses a UITabBarController which contains 4 different navigation controllers.
I have a table that contains maybe 10k to 100k rows and I need
I have a small APP which allows users to view information on Beers and
Some Background I have an iPhone app with three UIWebViews, each used to show
In my app i need to save changed values (old and new) when model

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.