9
votes

When I run my xcode project there is no error and app works perfectly.

But when I Archive it, it gives error like

receiver type *** for instance message is a forward declaration

1
You should change your title. Otherwise this will be marked as duplicate of other question you added in your question. - adev
@NaGibToroNgo, It is not duplicate. That is why I added previous comment. His question title is confusing. - adev
this message mostly means an import is missing. check whether you have an header file import inside #if DEBUG. - Hashmat Khalil
And how does your code look like? On what line of the code do you get the error? Without information we cannot help you. Archiving simply checks for more errors than running the code does, so it is not strange that it is only shown when Archiving. - fishinear

1 Answers

7
votes
  1. Locate the .h file where you are using @class *** where *** is the receiver type from the error message.
  2. Go to the .m file of the same name and make sure that you've imported the .h file or framework where *** type is declared.