“Expected method body” error

后端 未结 8 1351
天涯浪人
天涯浪人 2020-12-20 13:15

I had my application working fine, then without doing anything, out of nowhere I got 2 errors in appDelegate.h. One says this:

Expected

相关标签:
8条回答
  • 2020-12-20 14:02

    I usually find that a mysterious error like this happens because I accidentally typed a stray character into one of my other source files - either at the end of one of the other header files, or at the top of a .m file.

    Look at the top of the .m file that Xcode is trying to compile. Check it for stray characters. If you don't find any, look at which file is imported just before AppDelegate.h. Check for stray characters at the end of that other header file. If you have header files that import AppDelegate.h, you may have to check those too. (There's really no reason any other .h file should have to import AppDelegate.h.)

    0 讨论(0)
  • 2020-12-20 14:03

    I had the same problem it was like:

    -(void) gotoHome(){ ...}
    

    Because I am new to objective C, I forgot to "not using" opening and closing braces when send function arguments

    0 讨论(0)
提交回复
热议问题