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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:38:41+00:00 2026-05-28T13:38:41+00:00

I need to parse some XML that triggers an NSURLConnection. After the parsing finished,

  • 0

I need to parse some XML that triggers an NSURLConnection. After the parsing finished, I receive some data and then I set the root view controller. My problem is that application:didFinishLaunchingWithOptions: returns before the composeRootController method and an error occurs because the application cannot find any root view controller. How can I wait until composeRootController returns?

My code is the following:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self xmlConnect];
    return YES;
}

here xmlConnect function is implemented for parsing

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    //convertim la data a string
    NSString *receivedDataAsString = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding];
    NSLog(@"connectionDidFinishLoading %@", receivedDataAsString);

    //xml parsing
    xmlParser = [[NSXMLParser alloc] initWithData:receivedData];
    [xmlParser setDelegate:self];

    self.receivedData = nil;

    BOOL success = [xmlParser parse];

    if(success)
        NSLog(@"No Errors");
    else
        NSLog(@"Error Error Error!!!");

    [self composeRootController];
}

here composeRootController sets rootcontroller

  • 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-28T13:38:42+00:00Added an answer on May 28, 2026 at 1:38 pm

    Put your

     [self composeRootController];
    

    inside
    didFinishLaunching…

    And have composeRootController call xmlConnect.

    You might have to move the xmlConnect method out of your app delegate.

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

Sidebar

Related Questions

In my flash, the socket server returns some xml data that I need to
I need to store some arbitrary XML data in an XHTML HEAD element, that
I need to download and parse some XML data, and to store it in
I need to parse a XML String so I can use some of the
Need to parse a file for lines of data that start with this pattern
I am trying to parse some xml data by passing the variables with a
I have xml data that is retrieved from a server and I need to
I am trying to parse some XML that looks similar to this: <document> <headings>
I am currently parsing some xml that looks like this <Rows> <Row MANUFACTURERID=76 MANUFACTURERNAME=Fondont
So, I need to be able to parse xml files that could include namespace

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.