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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:45:07+00:00 2026-06-10T13:45:07+00:00

I am trying to parse a URL to grab the scheme, path, and parameters

  • 0

I am trying to parse a URL to grab the scheme, path, and parameters using the methods provided in NSURL class reference. I’m noticing however, that if I build the url this way (no double slash after the scheme):    

NSString *urlString = @"customScheme:myPath?parameter=hello&other_parameter=12";
NSURL *url = [NSURL URLWithString:urlString];

I can not grab any of those values from the NSURL. in other words, the methods

path
query

return nil.

If i add the double slashes like this:

NSString *urlString = @"customScheme://myPath?parameter=hello&other_parameter=12";
NSURL *url = [NSURL URLWithString:urlString];

everything works fine. Why is this?

Thanks!

  • 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-10T13:45:10+00:00Added an answer on June 10, 2026 at 1:45 pm

    These methods are very clearly documented in Apple’s docs:

    path
    Returns the path of a URL conforming to RFC 1808.

    - (NSString *)path

    The path of the URL, unescaped with the stringByReplacingPercentEscapesUsingEncoding: method. If the receiver does not conform to RFC 1808, returns nil.

    https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html

    And RFC 1808 is very clear about what constitutes a valid relative URL:

    <scheme>://<net_loc>/<path>;<params>?<query>#<fragment>

    http://www.w3.org/Addressing/rfc1808.txt

    If you want to parse mailto: URLs and the like, you’ll have to use something other than NSURL to do it.

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

Sidebar

Related Questions

I am trying to parse my URL into different parts using this RegExp: ([\w\\.-]*)
i am using http://www.asual.com/jquery/address/ plugin and trying to parse some url, this is what
Trying to parse an SQL string and pull out the parameters. Ex: select *
Im trying to parse the string located in /proc/stat in a linux filesystem using
I'm trying to parse some XML data using jQuery, and as it stands I
I'm trying to use the jQuery.url plugin ( http://projects.allmarkedup.com/jquery_url_parser/ ) to grab a specific
I'm trying to parse a web service response using SAXParser and get certain values,
I am trying to parse a bunch of XML files. I am using Nokogiri,
I have an xml feed at this url Now im trying parse the content,
I'm trying to dynamically grab a Google Fonts css file so I can parse

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.