bang590 / JSPatch

JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
MIT License
11.37k stars 2.24k forks source link

NSString.stringWithFormat后面能用''单引号而非""双引号吗? #859

Open iOS-Misaki opened 4 years ago

iOS-Misaki commented 4 years ago

这个是OC的写法: string = [NSString stringWithFormat:@"abc%@",str];

文档的标准写法是: string = NSString.stringWithFormat("abc%@", str);

我想问的是这种写法会生效么? string = NSString.stringWithFormat('abc%@', str);

这两者区别就是单引号和双引号的区别,js语法中单用单引号和单用双引号是没有区别的,但是在用JSPatch语法检查的时候,单引号没有通过,这个是为什么?