笔记1《转载》
NSURL *url = [NSURL URLWithString:@"http://www.testurl.com:8080/subpath/subsubpath?uid=123&gid=456"];
下面是常用的几个接口,和它们的输出。接口意思都符合相关RFC里的定义。
[url scheme] = http
[url host] = www.testurl.com
[url port] = 8080
[url path] = /subpath/subsubpath
[url lastPathComponent] = subsubpath
[url query] = uid=123&gid=456