1 variables quotes xcode objective-c
我正在尝试做这样的事情:
NSAppleScript *sendCharlieImput = [[NSAppleScript alloc] initWithSource:@"tell application \"terminal\" to do script " charlieImputSelf " in front window"];
[sendCharlieImput executeAndReturnError:nil];
Run Code Online (Sandbox Code Playgroud)
变量charlieImputSelf将作为命令放入终端窗口.但我需要将charlieImputSelf放在2个qoutes之间(如上所述).这显然不是正确的方法.有人可以帮忙吗?
谢谢!以利亚
bbu*_*bum 10
沿着不得不就每一行代码提出问题的道路走下去并不会带来成功.
要回答这个问题,您需要stringWithFormat::
[NSString stringWithFormat: @"some random string \"with quotes\" and %@ word in the middle.", @"this"];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1762 次 |
| 最近记录: |