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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:47:38+00:00 2026-05-29T20:47:38+00:00

I have a tableView where the user can add contacts to. These contacts get

  • 0

I have a tableView where the user can add contacts to. These contacts get saved to a mysql database and then returned to the user. Thing is, he has to update it manually in order to get the updated xml. But I wanna do it when he adds a contact so it gets shown right away. I tried various things and always ended up with either an error or he parsed the database more than once in the tableview. I thought of deleting all contacts and pasting all of them again and then update it, but this also didn’t really work.
Here is how I do it at the moment:

To parse the XML:

- (void) doXMLParsing 
{
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"Key22"] == nil) {

} else {
self.filteredListContent = [NSMutableArray arrayWithCapacity:[self.tabelle count]];

self.tableView.scrollEnabled = YES;

tabelle = [[NSMutableArray alloc] init];

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; 
NSString *fileName = [prefs stringForKey:@"Key22"];
NSString *urlString = [NSString stringWithFormat: @"http://www.---.com/%@.xml", fileName];
NSURL *url = [NSURL URLWithString: urlString];

DataFileToObjectParser *myParser = [[DataFileToObjectParser alloc] parseXMLAtUrl:url toObject:@"Telefonbuch" parseError:nil];

for(int i = 0; i < [[myParser items] count]; i++) {
    Telefonbuch *new = [[Telefonbuch alloc] init];
    new = (Telefonbuch *) [[myParser items] objectAtIndex:i];
    [tabelle addObject:new];
    [self.tableView reloadData];
}
[XMLActivity stopAnimating];
}
}

In the viewDidLoad:

XMLActivity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(140.0f, 290.0f, 40.0f, 40.0f)];
[XMLActivity setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];

[self.view addSubview:XMLActivity];

[XMLActivity startAnimating];

[self performSelector:@selector(doXMLParsing)
           withObject:nil
           afterDelay:0];
return;
tabelle = [[NSMutableArray alloc] init];

Everything works fine right now. I just want to reparse the XML after a new contact is added so it will get displayed right away.

  • 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-29T20:47:39+00:00Added an answer on May 29, 2026 at 8:47 pm

    The solution was as obvious as simple, and I still wasted way too many time on this.
    Here is the solution:

    Just put

    [self doXMLParsing];
    

    at the end when you added a contact to the database.

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

Sidebar

Related Questions

I have a tableView, similar to Contacts. The user can add his contacts in
I have a tableview that is blank by default. User can add cells to
Currently, I have a table view that the user can add items and delete
I have very custom TableView like Add Contact View in iPhone's Contacts. I like
I have a tableView and when the user is selecting one of the cells,
I have TableView. My datasource is SQLite database. I'm trying to count a number
Hello i have tableview with many objects in it. If i want to add
I have a tableView which has cells with phone numbers. The app is not
I have a user interface where the user can check off a bunch of
In the tableview the user can tap the upper right button (navigation bar rightside)

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.