简体   繁体   中英

Expected Expression error in XCode for IOS

Thanks for all your help previously! I have finally created a functioning Open GL game. Only problem is that there is an error in the most basic part of the UI. The IBAction. Here is a screenshot of XCode at the time of the error (yes I finally can put in images!)

错误发生时的XCode屏幕截图

The code

-(IBAction)returnpress
    {
    cruzia.hidden = 0;
    textarea.hidden = 0;
    playbtn.hidden = 0;
    tutorialbtn.hidden = 0;
    optionsbtn.hidden = 0;
    trainingbtn.hidden = 0;
    back.hidden = 1;
    soundlbl.hidden = 1;
    music.hidden = 1;
    sound.hidden = 1;
    musiclbl.hidden = 1;
    cruzia.text = @"Cruzia";
    textarea.text = @"";
    if (clicked == 1)  {
        CFBundleRef mainBundle = CFBundleGetMainBundle();
        CFURLRef soundFileURLRef;
        soundFileURLRef =CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"click",                     CFSTR ("electronic click.wav"), NULL);
        UInt32 soundID;
        AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
        AudioServicesPlaySystemSound(soundID);
    }

}

Is always bringing up the error: expected expression If anyone can tell me how to rid myself of this error, I would be very appreciative.

-George

The problem is not with that method, it is with the one before it. You forgot to close the previous method with a closing curly brace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM