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
http://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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s