Xcode custom framework - No known method error

烈酒焚心 提交于 2019-12-10 12:08:10

问题


I'm making a framework using iOS-Universal-Framework.

All has been working well for a few days, but today I decided to change a method signature. Xcode seems to have cached the old version of my library/framework, and I can't get it to see my new code for anything. Although the header it presents has the correct signature, the compiler (and autocomplete) do NOT see the correct signature.

I've tried changing the Framework version and Current Library/Compatibility versions of my custom framework. I've cleaned both projects a bunch. Deleted Derived Data. Closed Xcode. Etc...

This is really, really frustrating, as I've now wasted almost 2 hours just trying to get Xcode to behave!

Has anyone encountered this error before? Does anyone know how to get Xcode to see the code I've actually written?


回答1:


Gaaahhhhhhh! Why is it always, ALWAYS, that I search forever and don't find an answer. Then, I post a question on StackOverflow and then find the answer myself in 2 minutes?

So irritating!

I solved my problem by doing the following:

  1. Clear all entries (except "$(inherited)") from framework search paths.
  2. Remove custom framework from project.
  3. Re-add custom framework to project.
  4. Clean and build.

I'm still not sure I understand all of the intricacies of how/why Xcode does what it does, but at least now my real code is seen and run!


First question that helped me was Xcode referencing old framework.

So, I search on "xcode disable automatic framework searching" and found Xcode referencing old/removed framework, causing multiple interface declarations.

I hope this at least helps someone else get their answer faster.




回答2:


I faced a similar problem but found a cached version of my custom framework in the same folder as my project output.

Here are the steps I took to resolve it:

  1. Right click on the project build product in Xcode and choose 'Show in Finder' to reveal the build folder.
  2. Look for the custom framework in this folder, and delete it.
  3. Clean and build.

In my case there was no need to change framework search paths or remove the custom framework from the project.



来源:https://stackoverflow.com/questions/15576399/xcode-custom-framework-no-known-method-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!