CoderMJLee / MJExtension

A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.
MIT License
8.52k stars 2.16k forks source link

图片地址数组,转json字符串时,//变成\/ #862

Closed iOS-Kel closed 6 months ago

iOS-Kel commented 6 months ago

例如: NSArray *arr = @[@"https://cdn.szyiqc.com/img1.png, @"https://cdn.szyiqc.com/img2.png"];

[arr mj_JSONString]; // 输入结果是 ["https:\/\/cdn.szyiqc.com\/img1.png", "https:\/\/cdn.szyiqc.com\/img2.png"]

导致图片路径错误了,这个咋整?

iOS-Kel commented 6 months ago

我的解决方法如下,供大家参考 [[imageUrls mj_JSONString] stringByReplacingOccurrencesOfString:@"\/" withString:@"/"]