如果我从textedit或web复制某些内容并将其粘贴到可本地化的文件中,则会显示此编译错误.如果我在可本地化的文件中键入它,它不会显示任何错误.我向你保证我使用了正确的格式和';' 在文件中.
"New" = "New";
"In Progress" = "In Progress";
"Waiting" = "Waiting";
"Closed" = "Closed";
Run Code Online (Sandbox Code Playgroud) 我想在下面的字符串中出现双引号,所以它看起来像:
"hi there == "
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的代码:
NSMutableString *s = [[NSMutableString alloc] init];
[s appendString:@""""];
[s appendString:@"hi there == ""\n\r"];
Run Code Online (Sandbox Code Playgroud)
相反,我只得到:
hi there ==
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
如何在NSString中添加引号?例如,string = @"my string with"Big string"";
我有一个奇怪的问题,我需要在nsstring中的'='符号后添加"".以下是示例
NSString *codes = [NSString stringWithFormat:@"%@",sessionToken];
NSString *slash = [NSString stringWithFormat:@"auth session_token=%@",codes]; << here I have to add the "".
Run Code Online (Sandbox Code Playgroud)
我试过了
NSString *slash = [NSString stringWithFormat:@"auth session_token=\"%@\"",codes];
Run Code Online (Sandbox Code Playgroud)
但它不起作用,结果显示这样\"value\".
我想初始化NSString是双haoutes的"hai"..它可能吗?有什么帮助吗?但是NSString*str = @"hai"; 我想在没有直接初始化的情况下将其转换为"hai"?有什么帮助吗?
我在方法中有这行代码:
system("osascript -e 'tell app "System Events" to restart'");
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,我有两个引号,并且由于这些终端命令要这么具体,我需要知道另一种方式来运行从ObjC系统命令.我已经尝试使用 '' 和/方法,但没有成功.
objective-c ×4
ios ×3
nsstring ×2
cocoa ×1
cocoa-touch ×1
ios11 ×1
iphone ×1
quotes ×1
string ×1
xcode ×1