开发者

Plus signs in UILabel text

开发者 https://www.devze.com 2023-04-05 12:30 出处:网络
I have an iPhone app that uses core.data as its storage and a rest api (apache jersey based). it retrieves data, saves it to core.data and then displays the data on the app.

I have an iPhone app that uses core.data as its storage and a rest api (apache jersey based).

it retrieves data, saves it to core.data and then displays the data on the app.

The problem i have is that the spaces are replaced with + signs...

Is this an encoding issue that comes from the 开发者_StackOverflowrest service?


Yes, that string has been URL Encoded. Spaces are replaced with + signs. Non alpha numeric characters are replaced by their ASCII equivalents.

I believe you want to decode it using

- (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号