【问题标题】:SOAP action in iphoneiPhone中的SOAP操作
【发布时间】:2010-07-29 09:51:03
【问题描述】:

我在 android 中使用 thid 代码,我需要在 iPhone 中使用相同的代码..具有适当的语法

NSString *soap = soapStart + "<" + soapAction + " xmlns:m='http://www.aras-corp.com/'>" + body + "</"+ soapAction + ">" + soapEnd;

屏幕上出现错误“二进制中的无效操作数+(具有结构'Struct NSString *' ans '字符 *' 我第一次尝试在我的应用程序中使用肥皂 替代代码 woukd b 赞赏

提前谢谢

【问题讨论】:

标签: iphone objective-c


【解决方案1】:

您不能像在Java 中那样使用“+”运算符从较小的字符串中连接较大的NSString

相反,您可以使用称为+stringWithFormat: 的方法从其他NSString 字符串创建一个新的NSString

NSString *soap = [NSString stringWithFormat:@"%@ <%@ xmlns:m='http://www.aras-corp.com/'>%@%@", soapStart, soapAction, body, soapEnd];

【讨论】:

  • @talktobijju : 不要忘记 Objective-C 中的 @ for String 声明
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多