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

  • Home
  • SEARCH
  • 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 7994833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:13:57+00:00 2026-06-04T14:13:57+00:00

Here is some interesting question .I am developing an app with tableview. Initially tableview

  • 0

Here is some interesting question .I am developing an app with tableview. Initially tableview is having 4 rows and all the 4 rows having same images in image views. When i click first row i manually added some sub rows under first row and reloaded the table view. When i second click on same row that i previously clicked i removed the objects that i added manually and reloading tableview. I want to change image for 1 st. row when 1 st. row is clicked and second click on 1 st. row then showing previous image same for all the four rows ..please tell me how to do this.

a=b=c=FALSE


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    ///////11111

if(a==FALSE && indexPath.row==0)

{

 [array insertObject:@"a" atIndex:1];

  [array insertObject:@"b" atIndex:2];

 [array insertObject:@"c" atIndex:3];

a=TRUE;


}

   else if(indexPath.row==0 && a==TRUE)

 {

 [array removeObject:@"a"];

  [array removeObject:@"b"];

  [array removeObject:@"c"];


        a=FALSE;
    }


 else if(a==FALSE && b==FALSE && indexPath.row==1)


    {
        [array insertObject:@"d" atIndex:2];
          [array insertObject:@"e" atIndex:3];
          [array insertObject:@"f" atIndex:4];
        b=TRUE;
    }
    else if(a==TRUE && b==FALSE && indexPath.row==4)
    {
        [array insertObject:@"d" atIndex:5];
        [array insertObject:@"e" atIndex:6];
        [array insertObject:@"f" atIndex:7];
        b=TRUE;
    }
    else if(a==FALSE && b==TRUE && indexPath.row==1)
    {
        [array removeObject:@"d"];
        [array removeObject:@"e"];
        [array removeObject:@"f"];
        b=FALSE;
    }
    else if(a==TRUE && b==TRUE && indexPath.row==4)
    {
        [array removeObject:@"d"];
        [array removeObject:@"e"];
        [array removeObject:@"f"];
        b=FALSE;
    }



    /////////3333333333

    else if(a==FALSE && b==FALSE && c==FALSE && indexPath.row==2)
    {
        [array insertObject:@"m" atIndex:3];
        [array insertObject:@"n" atIndex:4];
        [array insertObject:@"p" atIndex:5];
        c=TRUE;
    }
    else if(a==FALSE && b==TRUE && c==FALSE && indexPath.row==5)
    {
        [array insertObject:@"m" atIndex:6];
        [array insertObject:@"n" atIndex:7];
        [array insertObject:@"p" atIndex:8];
        c=TRUE;
    }
    else if(a==TRUE && b==FALSE && c==FALSE && indexPath.row==5)
    {
        [array insertObject:@"m" atIndex:6];
        [array insertObject:@"n" atIndex:7];
        [array insertObject:@"p" atIndex:8];
        c=TRUE;
    }
    else if(a==TRUE && b==TRUE && c==FALSE && indexPath.row==8)
    {
        [array insertObject:@"m" atIndex:9];
        [array insertObject:@"n" atIndex:10];
        [array insertObject:@"p" atIndex:11];
        c=TRUE;
    }


        else if(a==TRUE && b==TRUE && c==TRUE && indexPath.row==8)
        {
            [array removeObject:@"m"];
             [array removeObject:@"n"];
             [array removeObject:@"p"];
            c=FALSE;
        }
        else if(a==TRUE && b==FALSE && c==TRUE && indexPath.row==5)
        {
            [array removeObject:@"m"];
            [array removeObject:@"n"];
            [array removeObject:@"p"];
            c=FALSE;
        }
        else if(a==FALSE && b==TRUE && c==TRUE && indexPath.row==5)
        {
            [array removeObject:@"m"];
            [array removeObject:@"n"];
            [array removeObject:@"p"];
            c=FALSE;
        }
    else if(a==FALSE && b==FALSE && c==TRUE && indexPath.row==2)
    {
        [array removeObject:@"m"];
        [array removeObject:@"n"];
        [array removeObject:@"p"];
        c=FALSE;
    }


    //////4444444444
    if(indexPath.row==[array count]-1)
    {
      ---
    }

    [tableview reloadData];
}
  • 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-04T14:13:59+00:00Added an answer on June 4, 2026 at 2:13 pm

    I assume you are filling the table view with an array that has dictionaries.
    You could set a flag into a dictionary (something like ‘expanded’ or ‘collapsed’) and then check if the flag is true/false in cellForRowAtIndexPath so that you can set an image according to the flag.

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

Sidebar

Related Questions

So I have an interesting design question regarding an app I'm developing for the
Here's an interesting question. I have a system that attempts to run some initialization
Not too practical maybe, but still interesting. Having some abstract question on matrix multiplication
I found some interesting post about memory usage and CPU usage here on Stack
Here is some dprofpp -I output, for almost the same program on different input
Here's some code (full program follows later in the question): template <typename T> T
So, I'm developing a REST webservice using RESTeasy and Google App Engine. My question
Here's an interesting question :) I have two vectors of matrices which I want
Here's an interesting question about the various quirks of the C++ language. I have
Here's an interesting question - when should you force automatic updates? I was thinking

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.