“Expected method body” error

后端 未结 8 1404
天涯浪人
天涯浪人 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 13:44

    This message can also happen after pasting some code from Internet. There may be some invisible characters in your snippet.

    • What you see in XCode with invisible chars OFF
      What you see in XCode
    • What's hidden (viewed in another text editor)
      What's hidden (viewed in another text editor)
    • What XCode 7.3 shows with invisible chars turned ON*
      What XCode 7.3 shows with invisible chars turned ON
      You can configure XCode 7.3 to show the invisible characters by going in "Preferences...>Key bindings". Find "invisible" and choose a key combination (Command+shift+F1 for instance).

    So ONE of the solutions (see others above...) if you have the "Expected Method Body" error is to re-type the erroneous line from scratch.

提交回复
热议问题