There is no solution for automatically associating and completing the code.
I found a lot of solutions on the Internet. Generally, the following solutions are used. After I tried them, I did not respond. I finally found the cause. The first method can only take effect using the pod project. The second method has no pod files. can take effect.
CocoaPods has been used for some time to manage the Objective-c class library, which is quite convenient. However, there is a small problem. When I input the import keyword in xcode, there is no function to automatically associate the code, and I need to manually complete the file name, which is hard to adapt.
The solution is found on stackoverflow:
Go to the Target > ”Build Settings” tab and find the ”User Header Search Paths” setting.
Set this to ”$(BUILT_PRODUCTS_DIR)” and check the ”Recursive” check box.
Now the built target will search the workspace’s shared build directory to locate the linkable header files.
Simply put, there are several steps:
- Select Target-> Build Settings, and find the User Header Search Paths Settings.
- Add a value "$ {SRCROOT}" and select Recursive. In this way, xcode recursively searches for files in the project directory.
The auto-completion function is ready for use immediately.
The following is the correct solution (the second method)
I. Problem:
After Xcode 7.3 is upgraded, you cannot automatically associate the imported header file.
Ii. solution:
Open Xcode --> Target --> BuildSettings --> Weak References in Manual Retain Release under Apple LLVM 7.1-Language-Objective C and set it to YES. You can use it after you run it.
I used it to discover the problem. Every time I had to compile some files, it was very painful. Is there a better solution?