文鹏教育

博客园 首页 新随笔 联系 订阅 管理

NSURL *url = [NSURL URLWithString:@"http://www.baidu.com/s?tn=baiduhome_pg&bs=NSRUL&f=8&rsv_bp=1&rsv_spt=1&wd=NSurl&inputT=2709"];
    
    NSLog(@"Scheme: %@", [url scheme]);
    
    NSLog(@"Host: %@", [url host]);
    
    NSLog(@"Port: %@", [url port]);
    
    NSLog(@"Path: %@", [url path]);
    
    NSLog(@"Relative path: %@", [url relativePath]);
    
    NSLog(@"Path components as array: %@", [url pathComponents]);
    
    NSLog(@"Parameter string: %@", [url parameterString]);
    
    NSLog(@"Query: %@", [url query]);
    
    NSLog(@"Fragment: %@", [url fragment]);
    
    NSLog(@"User: %@", [url user]);
    
    NSLog(@"Password: %@", [url password]);

 
posted on 2015-03-18 16:13  zhoup  阅读(843)  评论(0)    收藏  举报