NSString 转化 NSURL NSURL 转化 NSString

1 NSString 转化 NSURL  
2 SString *urlString=[@"http://www.google.com/search?client=safari&rls=en&q=搜索&ie=UTF-8&oe=UTF-8" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
1 NSURL 转化 NSString
2 NSURL *url=[NSURL URLWithString:urlString];  
3 NSString *s=[[url absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];  

 

 

posted @ 2015-07-07 13:21  bit by bit  阅读(528)  评论(0编辑  收藏  举报