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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:58:34+00:00 2026-06-05T09:58:34+00:00

What I am having is – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString

  • 0

What I am having is

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        cell = customCell;
        self.customCell = nil;
    }

    // Configure the cell.
    switch (indexPath.row) {
        case 0:
            cell.title.text = @"iPhone!";
            cell.date.text = @"December 25, 2009";
            cell.imageView.image = [UIImage imageNamed:@"iphone.png"];
            break;
        case 1:
            cell.title.text = @"Second Cell";
            cell.date.text = @"December 26, 2009";
            //Put in your own image. Make sure it is 120 by 100
            cell.imageView.image = [UIImage imageNamed:@""];
            break;
        default:
            break;
    }
    return cell;
}




// Override to support row selection in the table view.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"index %d",indexPath.row);
    NSIndexPath *index = [NSIndexPath indexPathForRow:indexPath.row inSection: 0];
    NSArray *array = [NSArray arrayWithObject: index];
    cell.title.text = @"tetete";
    [self.myTable reloadRowsAtIndexPaths: array withRowAnimation: UITableViewRowAnimationFade];
}

My purpose is if you click on the a row, you will change the text of label of this row.

However, reloadRowsAtIndexPath will invoke cellForRowAtIndex and this time it will assign the old text to the uilabel

My question : how should I change so that I can change the value of the uilabel after click on the row

  • 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-05T09:58:36+00:00Added an answer on June 5, 2026 at 9:58 am

    You can set value to the label in the method

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

    And can access the cell by the line,

    NSIndexPath * path = [NSIndexPath indexPathForRow:0 inSection:1];
            UITableViewCell * cell = [tableView cellForRowAtIndexPath:path];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having C++ console utility. The code inside parses the command line input and depending
having read the docs, https://docs.djangoproject.com/en/dev/topics/signals/ i have created this in my signals.py file: from
Having this problem with my android app I struggled with this for some time
Having read and googled to the point of exhaustion, I feel as though I
Having a @MappedSuperClass SomeClass (see below for a minimal example), is it possible to
Having a standard WinForms 2.0 PropertyGrid control I'm looking for a way to either
Having a little trouble in getting image attachment urls in wordpress. This is my
Having some odd behavior I'd love some feed back on as I can't seem
Having Followed these threads: - Xcode always stopping at main.m after a crash -
Having a trait trait Persisted { def id: Long } how do I implement

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.