0

I am using thid code in android,I need the same code in iPhone..with appropriate syntex

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

error appers on screen "invalid operands in binary +(have struct 'Struct NSString*' ans 'char *' I am first time trying to use soap in my application alternate code woukd b appreciated

Thankx in advance

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Talktobijju
  • 450
  • 1
  • 5
  • 14
  • possible duplicate of [How to Concatenate String in Objective-C (iPhone) ?](http://stackoverflow.com/questions/1158860/how-to-concatenate-string-in-objective-c-iphone) – Brad Larson Jul 29 '10 at 17:17

1 Answers1

2

You can't concatenate a larger NSString from smaller strings using the "+" operator, like you do in Java.

Instead, you create a new NSString from other NSString strings, using a method called +stringWithFormat::

NSString *soap = [NSString stringWithFormat:@"%@ <%@ xmlns:m='http://www.aras-corp.com/'>%@%@", soapStart, soapAction, body, soapEnd];
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345