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

The Archive Base Latest Questions

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

i am building a form when a button is pressed. When the button has

  • 0

i am building a form when a button is pressed. When the button has been pressed, an ASIHTTPRequest to a server get send. This server is returning a XML document, which i am building a form of.

the method, which is building up a form looks like this:

- (void) traverseElement:(TBXMLElement *)element {
    static CGFloat y = 300.0f;
    static CGFloat dynamicHeight = 400.0f;

    do {

    if ([[TBXML elementName:element] isEqualToString:@"wcqQuestionText"]) {
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(75, y, 200, 50)];
        label.text = [TBXML textForElement:element];
        [scrollView addSubview:label];
        scrollView.contentSize = CGSizeMake(768, dynamicHeight);
        [formulierText removeFromSuperview];
        [label release];
        y += 50.0f;
        dynamicHeight += 50.0f;

    }

    if([[TBXML elementName:element] isEqualToString:@"wcqAnswerValues"]) {
        NSString *segmentItemsStr = [TBXML textForElement:element];
        NSArray *segmentItemsArray = [segmentItemsStr componentsSeparatedByString:@";"];
        UISegmentedControl *answer = [[UISegmentedControl alloc] initWithItems:segmentItemsArray];            
        answer.frame = CGRectMake(50, y, 400, 40);
        [answer addTarget:self action:@selector(textpopup:) forControlEvents:UIControlEventValueChanged];
        answer.segmentedControlStyle = UISegmentedControlStyleBar;
        [scrollView addSubview:answer];
        scrollView.contentSize = CGSizeMake(768, dynamicHeight);
        [formulierText removeFromSuperview];
        [answer release];
        y += 40.0f;
        dynamicHeight += 40.0f;
    }

    if([[TBXML elementName:element] isEqualToString:@"rayonfiliaal"]) {   
    NSString *rayonFiliaal = [TBXML textForElement:element];
    [stringsArray addObject:rayonFiliaal];

    }

    if([[TBXML elementName:element] isEqualToString:@"filiaal"]) {

    NSString *filiaalNaam = [TBXML textForElement:element];    
    [filiaalArray addObject:filiaalNaam];

    }       
    if ([[TBXML elementName:element] isEqualToString:@"formdata"]) {  
        y = 300.0f;
        dynamicHeight = 400.0f;
    }
    // if the element has child elements, process them
    if (element->firstChild) 
        [self traverseElement:element->firstChild];
    // Obtain next sibling element
} while ((element = element->nextSibling));
}

What i wanted to do is:

If an user fills in the form. I need to save it as a local XML file, with the values in it.
What is the best way to achieve this?

  • 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-24T17:38:30+00:00Added an answer on May 24, 2026 at 5:38 pm

    You could just store those values in a plist.

    This link should show you how to create a plist.

    Property List Programming Guide

    You can just read each of the values in the label by using this method [label text];

    For the segmented control you would use the following method
    [answer titleForSegmentAtIndex:index];

    These methods will return a NSString which you can store in a NSDictionary.

    Once you have gotten those values, just create the NSDictionary object and call [dictionary writeToFile:pathToDirectory atomically:YES];

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

Sidebar

Related Questions

I'm building a Flex/Flash Builder 4 application that loads data using E4X/XML, like this:
I am building an app which contains a form in one view,in which the
I'm parsing a JSON response via $.ajax() and building a form from this object's
I am building a small application in RoR that has a form asking for
I am building an application in which I want to display a button on
I am building a ASP.NET page which is an Sales Order Processing Form I
I'm building a form with a single field and a submit button. A user
I'm building form validation controls for our C# ASP application. The bulk of the
I'm building a form with php/mysql. I've got a table with a list of
I am building a form in Zend Framework 1.9 using subforms as well as

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.