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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:33:08+00:00 2026-06-17T01:33:08+00:00

My app parses an online XML file. I am trying to add a feature

  • 0

My app parses an online XML file. I am trying to add a feature that will scan the LINK from each item in the xml for certain keywords, and return them to an NSString. I set it up to do this when it parses using:

 NSString *string = [NSString stringWithContentsOfURL:[NSURL URLWithString:articleUrl] encoding:NSUTF8StringEncoding error:nil];
            NSMutableArray *substrings = [NSMutableArray new];
            NSScanner *scanner = [NSScanner scannerWithString:string];
            [scanner scanUpToString:@"Thought:" intoString:nil]; 
            while(![scanner isAtEnd]) {
                NSString *substring = nil;
                [scanner scanString:@"Thought:" intoString:nil]; 
                if([scanner scanUpToString:@"</body>" intoString:&substring]) {

                    [substrings addObject:substring];
                }
                [scanner scanUpToString:@"Thought:" intoString:nil]; 
            }
            [substrings release];

The issue is that the XML has many items, this takes time, and the TableView cells don’t appear until after this task is completed. Is there a quicker way that could work?

  • 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-17T01:33:10+00:00Added an answer on June 17, 2026 at 1:33 am

    Quicker will be very relative. (file size, number of things to search for, algorithm used, etc…)
    You might try a few other approaches.
    NSXMLParser is another one.
    NSRegularExpression is another.
    It might be more efficient to first capture all the links then parse them.
    But again, that’s a very general statement.

    To keep your UI responsive while parsing, create a subclass of NSOperation and use that operation in the background. Have the NSOperation subclass send a Notification on the main thread when complete (or for each item added to your data structure). Make your app delegate (or whatever controller is appropriate) an observer for the Notification. You can have a separate Notification for completion and leverage that to provide a progress indicator stop.

    This gives you a responsive UI, callbacks and hooks to update with.

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

Sidebar

Related Questions

I have parsed several items of weather data from an online xml file. One
I'm working on a small app that uses and xml file to print an
I am trying to access an online XML file and display it's contents within
I have a Java app while parses input from a spreadsheet. I've added the
In my app, the root view controller acquires information from the internet, parses it,
The App that I'm working on requires to parse a very big Json file
I have a MySQL database/table set up and a .php file online that inserts
i'm making an app that requires indefinite textviews and images. i'm trying to implement
I'm creating an app where you have to download a txt file online. This
All the examples that I can search online use the App.Config mode of specifying

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.