为什么我在Xcode中遇到此错误(以及在Theos中制作包时: :预期不合格的身份" 以下是我收到错误的代码行:
for(int i = 1; i< = 11; i ++){
这里是所有的codel
NSDictionary *myDictionary = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/PerPage.plist"];
for(int i = 1; i<=11; i++) {
NSString *str = [myDictionary valueForKey:[NSString stringWithFormat:@"Page%d", i]];
if(str && ![str isEqualToString:@"none"]){
if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str]]){
UIImageView *wallpaper = [[UIImageView alloc] initWithFrame:CGRectMake(i*320,0, 320, 568)];
wallpaper.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str]];
[self addSubview:wallpaper];
}
if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str]]){
UIWebDocumentView *docView = [[[UIWebDocumentView alloc] initWithFrame:CGRectMake(i*320, 0, 320, 568)] autorelease];
[docView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str]]]];
[docView setBackgroundColor:[UIColor clearColor]];
[docView setDrawsBackground:NO];
[self addSubview:docView];
}
}
}
以下是Theos的确切错误(但它在Xcode中是相同的)
**Compiling Tweak.xm...
Tweak.xm:5:1: error: expected unqualified-id
for(int i = 1; i<=11; i++) {**