Quickly using obj-c classes. Running, but giving unannounced errors like

I have a project written mostly in objective-c. Adding a quick file, which is a UIViewController that uses some of our other custom classes. I have everything listed in the bridge file.

When I run it in the emulator, everything is in order. But when I open the quick file in the editor, it complains about undeclared types, as if I did not add them to the bridge file. If I run the simulator, these errors disappear and they remain on the sidelines until I edit this quick file again.

Is there something I don't understand about the timing of the headline? Is this just an annoying bug in Xcode, or am I doing something wrong?

+4
source share
1 answer

This seems to be one of many Xcode related fast errors. I would recommend you do the following:

  • check the correctness of the specified header: go to the project → Assembly settings → find the line Objective-C Bridging Header "in the" Swift Compiler - Code Generation "section. The path to your header should be written there.

  • check for errors in your bridge file (unlikely, but still).

All your imports must be recorded in the form:

#import "MyFile.h"

or

#import <MyLib/MyFile.h>
  1. Clear project: go to product → Clear or press Cmd + Alt + K
  2. (this and the following steps solve most of the Xcode errors related to the fast) clean project. Derived Data Database:

→ → "" → → "" " "

  1. ( ) Xcode "~/library/Developer/Xcode/DerivedData/" . .
+2

All Articles