NSString *str=@"http://t3.qpic.cn/mblogpic/d05a8de7423b76095d7c/460";
NSURL *url1=[NSURL fileURLWithPath:str];
NSURL *url2=[NSURL URLWithString:str];
NSLog(@"url1=%@",url1);
NSLog(@"url2=%@",url2);
输出结果为:
url1=http:/t3.qpic.cn/mblogpic/d05a8de7423b76095d7c/460 -- file://localhost/
url2=http://t3.qpic.cn/mblogpic/d05a8de7423b76095d7c/460
转载于:https://www.cnblogs.com/usst/archive/2012/11/08/2760529.html