简体   繁体   English

iphone中的Web服务

[英]Web service in iphone

i have a webservice and implementing that ,but when i get the array from this weservice its showing characters like this 我有一个web服务并实现它,但是当我从这个weservice获取数组时它显示这样的字符
line brake in some keys. 某些钥匙中的线刹。 I am trying to replace that with stringbyreplacing occurance of string but nothing happens. 我试图用stringbyreplacing的字符串替换它,但没有任何反应。 Could anyone help me for this to replace this type of characters,show that when u want to show that data it don't contain this type of character.I am new to iphone development please help me 有人可以帮我替换这种类型的字符吗,表明当您要显示不包含这种字符的数据时。我是iPhone开发新手,请帮助我

thanks 谢谢

Hard to help without seeing the code, but I guess you are calling stringByReplacingOccurrencesOfString:withString: , but not assigning the result back to a variable. 没有看到代码很难帮助,但我猜你正在调用stringByReplacingOccurrencesOfString:withString: ,但是没有将结果赋给变量。 Notice how this method returns a new object, but does not change the callee. 请注意,此方法如何返回新对象,但不会更改被调用者。

If you want to remove newlines, I suggest you use stringByTrimmingCharactersInSet: : 如果你想删除换行符,我建议你使用stringByTrimmingCharactersInSet: ::

key = [key stringByTrimmingCharactersInSet:[NSCharacterSet  newlineCharacterSet]];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM