"Expected unqualified-id" error in Xcode and Theos?

995 views Asked by At

Why am I get in this error in Xcode (and also when making package in Theos: :Expected unqualified-id" Here is the line of code I get the error for:

for(int i = 1; i<=11; i++){

Here's all the 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];
    }
}
}

Here is the exact error from Theos (but it's the same in Xcode)

**Compiling Tweak.xm...
Tweak.xm:5:1: error: expected unqualified-id
for(int i = 1; i<=11; i++) {**
0

There are 0 answers