Tal*_*jju 1 iphone objective-c
I'm a newcomer to the iPhone world. (Previously, I've developed for android.)
I've got this code in one of my Android apps:
String body = "<Item type='Customer' id= '"+id+"' action='delete'/>";
Run Code Online (Sandbox Code Playgroud)
What's the same in Objective-C?
你可以使用-[NSString stringWithFormat:]:
NSString *body = [NSString stringWithFormat:@"<Item type='Customer' id='%@' action='delete'/>", idNum];
Run Code Online (Sandbox Code Playgroud)
假设ID存储在变量中idNum.(id实际上是Objective-C中的一个类型,因此您不希望将其用作变量名.)
| 归档时间: |
|
| 查看次数: |
1538 次 |
| 最近记录: |