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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:20:30+00:00 2026-05-15T14:20:30+00:00

how to pass local path to NSXMLParser like this NSXMLParser *xmlParser = [[NSXMLParser alloc]

  • 0

how to pass local path to NSXMLParser

like this

NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:storePath];

where storepath is a local path like this:

/var/mobile/Applications/56EEB906-2B73-493C-9BE7-2732440CDB69/Documents/xml1.php

and my code is like this:

//NSURL *urla = [[NSURL alloc] initWithString:storePath];
NSURL *urla = [[[NSURL alloc] init] fileURLWithPath:storePath];

//NSData *dataa = [NSData dataWithContentsOfURL:urla];

NSLog(@"urls ois %@",urla);

help me why i am getting null value

  • 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-15T14:20:30+00:00Added an answer on May 15, 2026 at 2:20 pm

    Try this one:

    NSArray *paths = NSSearchPathForDirectoriesInDomains(
                         NSDocumentDirectory,
                         NSUserDomainMask, YES
                     );
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSURL *urla = [NSURL fileURLWithPath:[documentsDirectory
                             stringByAppendingString:@"/xml1.php"]];
    

    More details at iPhone Application Programming Guide: Getting Paths to Application Directories.

    Update: There’s a common misunderstanding what stringByTrimmingCharactersInSet. It does not replace all whitespace in the string, it only removes leading and trailing whitespace.

    If you want to get rid of the spaces, you need to replace them yourself by using something like stringByReplacingCharactersInRange:withString:.

    However:

    • I am not sure what you would replace those strings with to get a valid path. As far as I know, on the simulator the path to the application’s Documents folder actually has spaces in it (which accidentally is called out in the document I linked).
    • I am not sure why would the spaces bother you. That string is a valid path (as long as you actually have created the <app>/Documents/xml1.php file, of course); and according to NSXMLParser documentation, initWithContentsOfUrl accepts any fully qualified URL with scheme supported by NSURL, and file:// is supported scheme.

    If there’s a particular error the NSXMLParser is returning, add it to your question (or ask another one), so we can help you with the actual problem.

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

Sidebar

Ask A Question

Stats

  • Questions 539k
  • Answers 539k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Turns out it was my bug, WinInet doesn't actually attempt… May 17, 2026 at 2:24 am
  • Editorial Team
    Editorial Team added an answer That message is usually an indication that some of your… May 17, 2026 at 2:24 am
  • Editorial Team
    Editorial Team added an answer You should look into alpha blending for drawing the bubbles.… May 17, 2026 at 2:24 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to local a properties file programmatically without having to pass it's fullpathname
The below method takes a path pointing to an XML file: tree.LoadContentFile(path); I pass
I have defined a local mirror for all repositories in the settings.xml file: <mirror>
When I run my Unit Tests, all tests pass, but instead of Test run
A followup to this question, Building select projects only with Team Foundation Build :
I need to be able to pass in the URL of the file download,
I need to pass a link to file from a user process to the
I've been researching how to do this and I can't figure out what I
Update : this is more-or-less a dupe , and it turns out to be
I want to use local variable annotations to do better AOP. One idea is

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.