我的问题是:为啥仅在使用 x86_64 编译时会出现此编译错误?以及如何解决?
My question is: why only when select x86_64 simulator compile error occurs? And how to solve?why Complie Error only when select x86_64 simulator "Cannot refer to declaration with an array type inside block"
环境: Xcode v8.3.2
测试代码:
+ (BOOL)updateSqlByFileName:(NSString *)file key:(NSString *)key, ...
{
va_list args;
va_start(args, key);
__block BOOL isOK = NO;
[_queue inDatabase:^(FMDatabase *_dataBase)//
{
isOK = [_dataBase executeUpdate:sql withVAList:args];
}];
va_end(args);
return isOK;
}
不同的编译方式,编译错误情况 :
【编译正常√】选择 Generic iOS Device 编译(Build)时:【armv7 + arm64】
CompileC Test.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC Test.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
【编译正常√】 选择真机: iPhone 4(7.1.2)编译(Build)时:【armv7】
CompileC Test.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
【编译错误×】选择模拟器: iPhone 5s(10.3),iPhone SE(10.3) ,iPhone 7 Plus(10.3)编译(Build)时:【x86_64】
CompileC Test.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
Complie Error :
Cannot refer to declaration with an array type inside block【编译正常√】选择模拟器: iPhone 5(10.3)编译(Build)时:【i386】
CompileC Test.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler