阅读背景:

NSURL组成部分详解

来源:互联网 
NSURL *url = [NSURL URLWithString:@"https://www.baidu.com/search?id=1"]; NSLog(@"scheme:%@", [url scheme]); //协议 http NSLog(@"host:%@", [url host]); //域名 www.baidu.com NSLog(@"absoluteString:%@", [url absoluteString]); //完整的url字符串 https://www.baidu.com:8080/search?id=1 NSLog(@"relativePath: %@", [url relativePath]); //相对路径 search NSLog(@"port :%@", [url port]); // 端口 8080 NSLog(@"path: %@", [url path]); // 路径 search NSLog(@"pathComponents:%@", [url pathComponents]); // search NSLog(@"Query:%@", [url query]); //参数 id=1NSURL *url = [NSURL URLWithString:@"https://www.ba


你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: