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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:34:02+00:00 2026-05-27T15:34:02+00:00

In my application I have a login page were the user can log in.

  • 0

In my application I have a login page were the user can log in.
Once the user has logged-in to his account, he should go to his dashboard page(home page).
On the dashboard page there are three buttons add, edit and logout but in a dashboard page I call the URL to read the XML file from viewDidLoad method before pressing any button.

I want to parse the XML file and save its value on the same page.

I have tried to parse the XML file on save page and I am using the value of the XML file on same page but I am not able to use that string value in another function on same page.
but I am not able to use the string user_login_xml in the above method which is on the same page.. instead I get an error exc_bad_access

- (void)viewDidLoad 
{
    NSString *EditProfileID=Dataid;
    NSString* result = [EditProfileID stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

    NSString *urlAsString =[NSString stringWithFormat:@"http://www.mybusinesscentral.co.uk/mobile/iphone_profile_id.php?id="];

    urlAsString=[urlAsString stringByAppendingString:result];
    NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:urlAsString]];

    urlCon = [[NSURLConnection alloc] initWithRequest:req delegate:self];
    if (urlCon) 
                {
                    NSMutableData *mutableData = [[NSMutableData alloc] init];
                    self.receivedData=mutableData;
                    [mutableData release];
                }       
                else //connection failed.
                {
                    UIAlertView *alert = [[UIAlertView alloc] 
    initWithTitle:NSLocalizedString(@"Error", @"Error")
    message:NSLocalizedString(@"Error connecting to remote server", @"Error connecting to remote server")delegate:self cancelButtonTitle:NSLocalizedString(@"Ok", @"Ok") otherButtonTitles:nil];
                    [alert show];
                    [alert release];
                }
                [req release];
        }

        - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 
        {
            [receivedData setLength:0];
        }

        - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data1 
        {
            [receivedData appendData:data1];
        }

        - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 
        {
            [connection release];
            self.receivedData = nil; 

            UIAlertView *alert = [[UIAlertView alloc] 
                                  initWithTitle:@"Error"
                                  message:[NSString stringWithFormat:@"Connection failed! Error - %@ (URL: %@)", [error localizedDescription],[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]] 
                                  delegate:self
                                  cancelButtonTitle:@"Ok"
                                  otherButtonTitles:nil];
            [alert show];
            [alert release];
        }

        - (void)connectionDidFinishLoading:(NSURLConnection *)connection 
        {
            NSString *receivedDataAsString = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding];

            [receivedDataAsString release];

            xmlParser = [[NSXMLParser alloc] initWithData:receivedData];
            [xmlParser setDelegate:self]; 
            [xmlParser parse];

            [connection release];
            self.receivedData = nil;
        }

        - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI  qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
        {
            if ([elementName isEqualToString:@"details"])
            {
                NSString *user_login = [attributeDict objectForKey:@"user_login"];
                user_login_xml = [NSString stringWithFormat:@"%@",user_login];
        }
        }

        -(IBAction)Btn_AddNew:(id)sender
        {
            if ([user_login_xml length]==0) 
            {
                AddNew *addnew = [[AddNew alloc]initWithNibName:@"AddNew" bundle:[NSBundle mainBundle]];

                [self.navigationController pushViewController:addnew animated:YES];
            }
            else 
            {
                SubmitYourListing_Active *SubmitListing=[[SubmitYourListing_Active alloc] initWithNibName:@"SubmitYourListing_Active" bundle:[NSBundle mainBundle]];
                SubmitListing.UserID=Dataid;
                [self.navigationController pushViewController:SubmitListing animated:YES];
            }
        }
  • 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-27T15:34:03+00:00Added an answer on May 27, 2026 at 3:34 pm

    I am using TouchXMl, you can download from

    https://github.com/TouchCode/TouchXML

    and installation guide Click here

    This is the easiest way to parse xml file, only few lines of code required.

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

Sidebar

Related Questions

In my application I have a feedback form. The user has to first login
i have an application and a user must log-in before he/she can access pages.
I have an asp.net c# web application where a user can log in and
I have an application I would like to force SSL on the login page
In my application, upon clicking login in the login page, I have to call
Ok simple question. I have a JSF application, containing a login page. The problem
I have made a web application that uses master page for Login & Logout
I have a JSP application that connects to oracle on the log in page.
i am doing one small application , wheich have login functionality, in the user
I've completed my login page. My problem now is I can only log in

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.