NSString NSUrl 相互转化
//NSString 转为 NSURL NSString *webStr = @"www.baidu.com"; NSURL *webUrl = [NSURL URLWithString:webStr]; //NSURL 转为 NSString NSString *newWebStr = [webUrl absoluteString];
//NSString 转为 NSURL NSString *webStr = @"www.baidu.com"; NSURL *webUrl = [NSURL URLWithString:webStr]; //NSURL 转为 NSString NSString *newWebStr = [webUrl absoluteString];