iphone error: expected '=', ',', ';', 'asm' or '__attribute__' before ' 'foo'

前端 未结 6 1525
忘掉有多难
忘掉有多难 2020-11-28 10:45

I\'m trying to port the speakhere example into another app and I\'m having issues. I copied all the files, and all the frameworks, but for some reason I get a bunch of comp

6条回答
  •  无人及你
    2020-11-28 11:13

    This might not have applied to this exact situation, but I had this exact error too, which was caused by a bad forward declaration. In Objective-C, make sure your forward-declares begin with the @ sign - e.g.

    @class MyClass;
    

    Those of us still on autopilot from C++ will forget the @, see that XCode has highlighted class as a reserved keyword, and think all is well with the world. It is not.

提交回复
热议问题