NSURL cheat sheet

There are lots of various parts of NSURL that you can access through methods, and the documentation on what exactly is included in each of those parts is sparse.  So I have here a cheat sheet that I created that I hope will be useful to others as well:

Based on:

http://user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

absoluteString
http://user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

absoluteURL
http://user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

fragment
anchor

host
www.test.com

lastPathComponent
someapi.php

parameterString
oneparam;twoparam

password
password

path
/somefolder/someapi.php

pathComponents
NSArray – (“/”,somefolder,”someapi.php”)

pathExtension
php

port
80

query
somekey=someValue&anotherkey=anotherValue

relativePath
/somefolder/someapi.php

relativeString
http://user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

resourceSpecifier
//user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

scheme
http

standardizedURL
http://user:password@www.test.com:80/somefolder/someapi.php;oneparam;twoparam?somekey=someValue&anotherkey=anotherValue#anchor

user
user

2 thoughts on “NSURL cheat sheet”

  1. Pingback: hyoki's me2day

Leave a Reply

Your email address will not be published. Required fields are marked *