Compiler error - iOS "expected ")" before "Question -


What's wrong with the following code? Xcode 4 is not compiling because of the "question" with two method declarations a "hope") question "" first ", message, as indicated in the code below given the code in the query question compiled And this code is already working. I have made some changes to the question but behind them try to figure out the error in this compile time

  #import & Lt; Foundation / Foundation.h & gt; #import "Question H" @interface AppState: NSObject {selectedAnsw er int i; int correctAnswers; integer currentQuestionNumber; // this question will be included in the hash table objects NSMutableDictionary * questionHash;} @property (nonatomic) integer chosenAnswer; @property (nonatomic) correctAnswers int i; @property (nonatomic) integer currentQuestionNumber ; maintaining @property (nonatomic,) NSDictionary * questionHash; - (void) PrintQuestions; - (void) PrintDescription; - (void) addQuestion: (question) Q; // & LT; === = error - ( Int) Number question: - (zero) saving strait; - (zero) reset; - Tion *) current questions; // & LT; ===== Error @end   

Here is the question.h:

  #import & lt; Foundation / Foundation.h & gt; #import "AppState.h" @ Interface Question: NSOBS {NSSTING * question text; Int correct answer; Int number; // There will be a hash table of questions - stuff NSMutableDictionary * answerHash; } @property (nontomic, write) NSString * questionTxt; @property (nanatomic) int correct answer; @protecti (nonomatic) int number; @protecti (nonomatic, intact) NSMutableDictionary * answerHash; - (empty) addAnswer: (NSString *) Answer; - (NSMutableArray *) Answers; - (zero) print descriptio; - (zero) print reply; - (NSString *) Correct AnswersText; - (Question *) Current question; @end    

circular dependency? Importing AppState is importing questions and questions from AppState.

For breaking the cycle, forward one of them - e.g. Use @ class question before your AppState @interface statement, like << p>

  @class question; @InteffusEpestate: NSOJject {In Search Engineer; Integer right answer; Int currentQuestionNumber; // The hash table of question objects will be NSMutableDictionary * questionHash; } ...   

Related Questions:

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -