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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:48:21+00:00 2026-05-18T03:48:21+00:00

I am in a need for someone to help me out on switching custom

  • 0

I am in a need for someone to help me out on switching custom cells when selected using didSelectRowAtIndexPath, so the idea is to have custom cell1 set as a state and when the user selects it this will disappear and cell2 will fade in which shows the capital of that state but other cells will remain as cell1 (or states) except the one which was selected.

  • 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-18T03:48:21+00:00Added an answer on May 18, 2026 at 3:48 am

    This is how I’d do it…

    tableView.h:

    #import <UIKit/UIKit.h>
    @interface tableView : UITableViewController {
        NSMutableArray *tableArray;
    }
    
    - (void)changeTitleAtIndexPath:(NSIndexPath *)indexPath;
    
    @end
    

    tableview.m (add these methods) :

    in -(void)viewDidLoad add:

        tableArray = [[NSMutableArray alloc] init];
        [tableArray addObject:[NSMutableArray arrayWithObjects:[NSNumber numberWithBool:NO],@"City1",@"Capital1",nil]];
        [tableArray addObject:[NSMutableArray arrayWithObjects:[NSNumber numberWithBool:NO],@"City2",@"Capital2",nil]];
        [tableArray addObject:[NSMutableArray arrayWithObjects:[NSNumber numberWithBool:NO],@"City3",@"Capital3",nil]];
        [tableArray addObject:[NSMutableArray arrayWithObjects:[NSNumber numberWithBool:NO],@"City4",@"Capital4",nil]];
    

    change:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }
    
        if (![[[tableArray objectAtIndex:indexPath.row] objectAtIndex:0] boolValue]) {
            cell.textLabel.text = [[tableArray objectAtIndex:indexPath.row] objectAtIndex:1];
        }else {
            cell.textLabel.text = [[tableArray objectAtIndex:indexPath.row] objectAtIndex:2]; 
        }
    
    
    
    
        return cell;
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
        [self changeTitleAtIndexPath:indexPath];
        [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop];
    }
    

    add:

    - (void)changeTitleAtIndexPath:(NSIndexPath *)indexPath{
        BOOL newBool = ![[[tableArray objectAtIndex:indexPath.row] objectAtIndex:0] boolValue];
        [[tableArray objectAtIndex:indexPath.row] replaceObjectAtIndex:0 withObject:[NSNumber numberWithBool:newBool]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need someone to help point out the obvious to me...been looking for hours
please someone help out from this headaround problem of me; I have dynamically created
could someone help me out? I have done a straight forward MySQL query from
I need someone help. When I open https://developers.facebook.com/docs/reference/api/ and clicked https://graph.facebook.com/me/likes?access_token=blablabla , I got
Please i need someone to help convert this query entity(c#) form. select * from
i m new to solr so i really need someone to help me understand
can someone help with this? I need the following function to do this... $x
I need to do a non greedy match and hope someone can help me.
I am stuck and in need of a hand. Hope someone can help? Anyone
I need someone to lead/guide me where have I code wrongly because I can't

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.