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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:26:09+00:00 2026-05-30T08:26:09+00:00

Basically, every time I enter something in my textfield and save it to the

  • 0

Basically, every time I enter something in my textfield and save it to the table, the previous entry will be replaced by the new one. How do I add elements in a mutable array and save the last entry? I tried

[tabledata addObject....

and in the entry

tabledata.lastObject objectAtIndex...

but that didn’t work.

here is what I have:

 -(void)viewDidLoad
{
    [super viewDidLoad];

    titlestring = [[NSUserDefaults standardUserDefaults] objectForKey:@"titlehomework" ];
    detailsstring = [[NSUserDefaults standardUserDefaults] objectForKey:@"detailshomework"];

    tabledata = [[NSMutableArray alloc] initWithObjects:titlestring, nil];

    tablesubtitles = [[NSMutableArray alloc] initWithObjects:detailsstring, nil];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    return [tabledata count];
}


-(UITableViewCell *)tableView:(UITableView *)tableView  cellForRowAtIndexPath:(NSIndexPath  *)indexPath;
{
    UITableViewCell *cell = nil;

    cell = [tableView dequeueReusableCellWithIdentifier:@"homeworkcell"];

    if(cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle   reuseIdentifier:@"homeworkcell"];
    }
    cell.textLabel.text = [tabledata objectAtIndex:indexPath.row];
    cell.detailTextLabel.text = [tablesubtitles objectAtIndex:indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:14.0];
    cell.textLabel.backgroundColor = [ UIColor clearColor ];
    cell.detailTextLabel.backgroundColor = [UIColor clearColor];

    //-----------------------------------------START----------------------------Set image of   cell----
    cellImage = [UIImage imageNamed:@"checkboxblank.png"];
    cell.imageView.image = cellImage;
   //--------------------------------------------END---------------------------end set image of cell--  

    return cell;
}
  • 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-30T08:26:11+00:00Added an answer on May 30, 2026 at 8:26 am

    Without seeing more code, the best I can do is suggest something like this

    [tabledata addObject:newTitle];
    [tablesubtitles addObject:newSubtitle];
    [tableView reloadData];
    

    This assumes both newTitle and newSubtitle are the NSStrings you wish to add and that tableView is the pointer to the UITableView.

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

Sidebar

Related Questions

So basically I am trying to create instances of the class below every time
Has anyone encountered nested iframes in their Rails/Facebooker application? Basically, every time I click
Any python libs for parsing Bind zone files? Basically something that will aid in
I want my model to save to the server every time it changes. I
I have a loop which basically calls this every few seconds (after the timeout):
Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML,
I've written a Windows Service in C# that basically checks my db every minute
Is there a way that I can trace every method, basically a line trace,
My partner and I have a webcam site that basically runs the old-school method....Every
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse

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.