宽容他人,放过自己。

webview加载含有中文的url显示空白

Posted on By anchoriteFili

// 在类目中添加这个方法
- (NSString *)URLEncodeString {
    NSCharacterSet *set = [NSCharacterSet URLQueryAllowedCharacterSet];
    NSString *encodedString = [self stringByAddingPercentEncodingWithAllowedCharacters:set];
    return encodedString;
}