Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

iphone - Objective-C error: expected '=', ',', ';', 'asm' or '__attribute__' before 'class'

I'm getting this from an iPhone app I'm working on. Not sure how to interpret the error... It's thrown at a few place in my code. I can't see any pattern of occurrence.

Is this a generic error? What's the meaning of it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error you posted indicates that you have a syntax error around your use of class. Manually inspect the first location the error is reported, and you might notice the cause.

To help you debug further, please include the surrounding code so we can better help you.

Most common causes:

  1. Missed @ in @class for forward class declaration in headers
  2. Missed ; after the declaration of an enum, a structure, or a typedef
  3. Copied C++ code, where class is used to declare a structure, but code is invalid in Objective-C

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...