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

  • Home
  • SEARCH
  • 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 3952740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:53:27+00:00 2026-05-20T01:53:27+00:00

I have written an application which loads information from a plist which lies on

  • 0

I have written an application which loads information from a plist which lies on my server (I hope this is OK with Apple :-)). The application runs smooth on WiFi but when using it on 3G the load times are a little too long. Therefore I would like to optimize the loading of my plist.

I imagine that I could store a copy of the plist on the device and only check if the remote plist has changed and if so, download it. I am not sure if this will be less data and therefore minimize the load time and I’m not even sure how this would be written in code.

Does anyone have an idea how I can minimize the loadtime and possibly post a code sample?

Right now I am using these two lines to load the plist and store it. FETCH_URL is obviously my URL.

NSURL *url = [NSURL URLWithString:FETCH_URL];
NSMutableArray *tmpArray = [[NSMutableArray alloc] initWithContentsOfURL:url];

EDIT: I am trying to use NSURLConnection as Thomas Clayson suggests but I can’t seem to figure out how to convert the data into an NSMutableArray.

This is in my viewDidLoad:

NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:FETCH_URL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    if (theConnection) {
        NSLog(@"Connection open.");
    }
    else {
        NSLog(@"Failed connecting.");
    }

Then I have these two methods to check if there is any new data and to check if all data has been collection.

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    NSLog(@"More data.");
    [receivedData appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    NSLog(@"Connection successful.");
}   
  • 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-20T01:53:28+00:00Added an answer on May 20, 2026 at 1:53 am

    I understand what you mean. You will want to use NSURLConnnection instead of initWithContentsOfURL.

    initWithContentsOfURL is synchronous. That means that it will run on the main thread and thus “hang” the application (this is because UI events have to occur on the main thread and if a process is happening (waiting for the plist to download) the app will ‘stop’).

    Anyway – if you use NSURLConnection then you will be able to do it asynchronously (on another thread). This means that for a while your app will be usable, but won’t display the data from the plist straight away. So you’ll need to handle the view to refresh the data when the connectionDidFinishLoading:.

    look it up anyway. 🙂 its very useful

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

Sidebar

Related Questions

I have written a application which runs in the background. I want to write
I have written a Ruby application which parses lots of data from sources in
I have written a java client server application (not http), which i need to
I have written a PHP application which requires storage of millions of integers between
I have written an application in which I want to convert a .jpg image
I am developing an application which requires to add Calendar event. I have written
I have written a small java application for which I need to obtain performance
I have application written in Visual Studio 2008 which I deploy with ClickOnce to
I have application which needs to use a dll (also written by me) which
I have a application written in wxPython which I want to make multilingual. Our

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.