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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:52:39+00:00 2026-05-18T22:52:39+00:00

i am writing one app in that app i have to display tableview with

  • 0

i am writing one app in that app i have to display tableview with two cells.while the first cell touched by the user then it have to show some other cells within the view (i cant use navigation here) and also second cell also visible..can any one tell me the suggestion for this.
thank you all.

  • 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-18T22:52:40+00:00Added an answer on May 18, 2026 at 10:52 pm

    If you want to insert table view cells when you are clicking on a cell, try the following code.

    Lets consider you are going to insert 3 rows in the position 1, 2 and 3 in the section 0. In the didSelectRowAtIndexPath method, do the following. Here the rows will be inserted in section 0, if we select row 0(first row) in section 0(first section).

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
       if (indexPath.row == 0 && indexPath.section == 0) {
    
           // Create indexPaths for the rows you are going to insert
    
           NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0]];
           NSIndexPath *indexPath2 = [NSIndexPath indexPathForRow:2 inSection:0]];
           NSIndexPath *indexPath3 = [NSIndexPath indexPathForRow:3 inSection:0]];
    
           // Increase the number of rows in section 0 by 3, as we are inserting 3 rows here
    
           numberOfRowsInSectionZero = numberOfRowsInSectionZero + 3;
    
           // Insert the rows
    
           [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath1, indexPath2, indexPath3, nil] withRowAnimation:UITableViewRowAnimationFade];
        }
    }
    

    In your numberOfRowsInSection method, you should be having something like the following,

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection: (NSInteger)section {
    
        // some code here
    
        if (section == 0) return numberOfRowsInSectionZero;
    
        // some code here
    }
    

    And make sure you are having appropriate code in cellForRowAtIndexPath method to display content in the newly displayed rows.

    Note: You have to alter your code in such a way that the rows are not inserted when clicking the row 0 of section 0, when they are already been inserted.

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

Sidebar

Related Questions

I'm writing a simple checklist app. I have two UIViewControllers. The first displays the
I'm writing an app that supposed to copy a bunch of files from one
For an app that I am writing I need to display several views (in
i'm writing a delphi app that communicates with excel. one thing i noticed is
I am writing a GUI app in Pyglet that has to display tens to
I'm writing two Django applications: one that generates a lot of data in time,
I am currently writing my first iPhone app, but have encountered an issue. I
I'm writing an iPhone app (which will be my first ios app) that has
I'm looking into writing a simple synchronization ability into my app and one of
I am writing a silly little app in C++ to test one of my

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.