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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:26:50+00:00 2026-06-09T12:26:50+00:00

I have the following Code in my XMLAppDelegate.m file: – (void)applicationDidFinishLaunching:(UIApplication *)application { [self.window

  • 0

I have the following Code in my XMLAppDelegate.m file:

- (void)applicationDidFinishLaunching:(UIApplication *)application {
    [self.window makeKeyAndVisible];

    self.products = [NSMutableArray array];
    XMLViewController *viewController = [[XMLViewController alloc] init];
    viewController.entries = self.products; // 2. Here my Array is EMPTY. Why?

    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:productData]];
    self.XMLConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];

    NSAssert(self.XMLConnection != nil, @"Failure to create URL connection.");

    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}

- (void)handleLoadedXML:(NSArray *)loadedData {
    [self.products addObjectsFromArray:loadedData]; // 1. here I get my Data (works fine)

    XMLViewController *viewController = [[XMLViewController alloc] init];
    [viewController.tableView reloadData];
}

I marked the problem. Is there any possibility to pass the loaded data (loadedData) to applicationDidFinishLaunching:?

Thanks in advance..

  • 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-06-09T12:26:51+00:00Added an answer on June 9, 2026 at 12:26 pm

    Where is your handleLoadedXML get called? If you want to pass it to applicationDidFinishLaunching can you just have your handleLoadedXML return that array and you can then call that method in applicationDidFinishLaunching.

    Edit:

    Think of it this way:

    You first have this:

    - (void)applicationDidFinishLaunching:(UIApplication *)application {
        [self.window makeKeyAndVisible];
    
        self.products = [NSMutableArray array];
        XMLViewController *viewController = [[XMLViewController alloc] init];
        viewController.entries = self.products; // 2. Here my Array is EMPTY. Why?
    
        NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:productData]];
        self.XMLConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
    
        NSAssert(self.XMLConnection != nil, @"Failure to create URL connection.");
    
        [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    }
    

    Note that here you don’t have self.products set up yet. It’s only allocated.

    After your application finished launching, then you have:

    // say you have something like this
    - (NSArray *)didFinishParsing {
        return someArray;
    }
    

    This method gets called somewhere, and then it calls the method below to set your self.products. Not until now is your self.products populated.

    - (void)handleLoadedXML:(NSArray *)loadedData {
        [self.products addObjectsFromArray:loadedData]; // 1. here I get my Data (works fine)
    
        XMLViewController *viewController = [[XMLViewController alloc] init];
        [viewController.tableView reloadData];
    }
    

    So if you want self.products to be populated in applicationDidFinishLaunching, you need to call the method that generates the array in applicationDidFinishLaunching, say didFinishParsing, and you can do self.products = [self didFinishParsing];, and then it will be set.

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

Sidebar

Related Questions

I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code public partial class MainWindow : Window { public MainWindow() {
I have following code in Java: import java.util.*; public class longest{ public static void
i have following code in my php jquery call... <object type=application/x-shockwave-flash data=mysounds/player.swf id=audioplayer1 height=1
I have following code: private void fileSystemWatcher_Changed(object sender, System.IO.FileSystemEventArgs e) { System.Diagnostics.Process execute =
I have following code in the html file: <div class=navbar navbar-fixed-top> <div class=navbar-inner> <div
I have following code for 3 DataGridView Controls in my VB.NET winform application. How
I have following code, after five tries (wrong words like dfasfasfb) the application stops.
I have following code in .h file #import <UIKit/UIKit.h> @interface MessDisViewController : UIViewController {
I have following code in Program.cs in console application class Program : IView {

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.