我正在做这本书的教程:Neil Smyth 的“Objective-C 2.0 Essentials 3rd edition”。我反复尝试过,但即使书籍版本声称可以运行,但仍然收到相同的“预期表达式”错误。我检查了太多次,我的版本和书上的完全一样。请,有人可以帮助我。下面的代码:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
@autoreleasepool {
int x;
int j = 54321;
for (x = 0; x < 10; x++) {
}
int j = x + 10;
NSLog (@"Variable j in for loop is %i", j);
NSLog (@"Variable j outside for loop is %i", j); /* I GET AN ERROR STATING " EXPECTED EXPRESSION HERE*/
}
return 0;
}