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 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
  • 2 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

Related Questions

I am doing pass-by-reference like this: use strict; use warnings; sub repl { local
Actually, this looks like the download feature, allowing a user to determine the local
I need to pass local path to HttpWebRequest in c#. i have test.xml in
How do I pass back a local variable from a function to main ,
From what I understand: when you pass by value, the function makes a local
I am using Hibernate with MySql, when i start my local server and pass
I want to pass '#' to the query string like ?page.aspx?someParam=1234#5 .
I've got this piece of code: using Posix; int fuseguifs_getattr(string path, Posix.Stat *stbuf) {
I'm using this code to download the timeline page from our local Trac system:
I am trying to make this function download file from the internet. I pass

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.