1

In my view this is one of the strangest problem i have ever come across in iPhone app development.

Let me explain the scenario , i have main screen 'A' on which i have a Button that directs me to another Screen say 'B'. Now on Screen 'B' i have a feature in which user can send a mail to his friend for promotion purpose e.g a user wishes to tell a frnd about this app so i used MFMailComposeViewController and a view is generated where the user types the address and click send ( subject and body of mail is automatically generated ). After sending the mail a new view opens say screen 'C' and here i want to give the user the options . 1. Go to Screen 'A' ( which is main screen of the app ) 2. Go back to Screen 'B' ( from where the user requested to send a mail to his frnd ).

Now the strange part i cannot declare the variables ( Screen 'A' and 'B' ) of both these files here at in header file of screen 'C' . Even when i declare the header file at the top it generates an error. The variables can be easily be declared and used for other screens but not for these 2 screens. Can anybody please explain wats the problem.? this the text of the error "/Users/admin/Documents/AppName/Classes/A.h:42: error: expected specifier-qualifier-list before 'B'" Thanks Guys !

Taimur

Taimur Ajmal
  • 2,778
  • 6
  • 39
  • 57

1 Answers1

0

you can normally use @class to resolve circular dependencies if that is what is is, but by the sounds of the error, it could just be a stray semi-colon or other syntax error in a header.

Andiih
  • 12,285
  • 10
  • 57
  • 88
  • not its not AnDiih this problem is i cannot do this , as there is a stack. http://developer.apple.com/iphone/library/documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html – Taimur Ajmal May 19 '10 at 19:37
  • @Andiih This is what i am doing. I wrote #import "AboutUS.h" in the file MailComposerViewController.h and it gave me error in the AboutUS.h file at this line. MailComposerViewController *mailWindow; The statement of the error is /Users/admin/Documents/iTrace copy/Classes/../AboutUS.h:20: error: expected specifier-qualifier-list before 'MailComposerViewController' – Taimur Ajmal May 25 '10 at 13:45
  • Well your options are to use @class AboutUS; in MailComposerViewController.h and use the #include in the .m file - this will resolve any circular dependency, but my gut feel is that there is an error in AboutUS.h somewhere around line 19! – Andiih May 25 '10 at 13:59
  • If my answer worked for you, click Accept (the tick). You might want to go back over older questions and do the same! – Andiih Jun 01 '10 at 18:21