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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:16:37+00:00 2026-05-24T21:16:37+00:00

Hey guys i have a table view that can add and delete cells. but

  • 0

Hey guys i have a table view that can add and delete cells. but when i delete the only cell that comes with the app, and i try to add a new cell with the text of “Meghan Way” and the text just automatically changes it self to the original cells text which is “House 1” here is my code!

- (IBAction)saveButton:(id)sender {
FacePlatesViewController * viewController = (FacePlatesViewController   
*)self.parentViewController;

[viewController addObject:[NSMutableDictionary dictionaryWithObject:text.text    
forKey:@"name"]]; 

[self dismissModalViewControllerAnimated:YES];
}

- (IBAction)cancel:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}



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

static NSString *CellIdentifier = @"Cell";

cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero   
reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.text = [[cells objectAtIndex:indexPath.row] valueForKey:@"name"];
UIImage * myimage = [UIImage imageNamed: @"check.png"];
image = [[UIImageView alloc]initWithImage:myimage];



tableView.backgroundColor = [UIColor clearColor];


    self.myTableView = tableView;


}
return cell;

}

this is for the save button! any help would be very appreciated:D 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-24T21:16:38+00:00Added an answer on May 24, 2026 at 9:16 pm

    You code is quite messed up. I have improved it below and added comments:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:   
    (NSIndexPath *)indexPath
    {
    
        static NSString *CellIdentifier = @"Cell";
    
        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil)
        {
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero   
        reuseIdentifier:CellIdentifier] autorelease];
        }  //The if block should end here. You should set the cell's label irrespective whether the cell was nil. This is the cause of the issue you are facing.
    
        cell.textLabel.text = [[cells objectAtIndex:indexPath.row] valueForKey:@"name"];
    
        //You are doing nothing with the UIImage
        //UIImage * myimage = [UIImage imageNamed: @"check.png"];
        //image = [[UIImageView alloc]initWithImage:myimage];
    
    
        //You should be setting the background color just once, in ViewDidLoad, not here.
        //tableView.backgroundColor = [UIColor clearColor];
    
        //I don't see why this is required
        //self.myTableView = tableView;
    
        return cell;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a Table View that has been populated with 21 data:
Hey guys I have a query that selects data and organizes but not in
Hey guys I have a bean that comes back and one of the properties
Hey guys I have an older site that is coded in AS2(I can't get
Hey guys, I currently have a root table view which has a toolbar at
Hey guys, I have an table in which the user can tap on items
Hey guys I have an admin page that checks if you are admin before
Hey guys I have one more question lol. I am using a script that
Hey guys I have a query that currently finds the latest comment for each
Hey guys I have what should be a simple question, but I am new

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.