0

I'm trying to create my own framework for iOS and I am encountering many problems. I followed Ray Wenderlich's tutorial here:

http://www.raywenderlich.com/65964/create-a-framework-for-ios

And successfully created my framework. I dragged it into one of my apps and tried to start using it. Before I got very far I was being complained at by the compiler that there was an Apple Mach-O Linker Error due to a global variable (declared with "extern" in one of the header files of my framework) being referenced by one of the classes of my framework. Though this was annoying the particular global variable in question was not necessary in that situation, so I removed the reference to it from the file that was being complained about. I deleted my framework from my app, rebuilt the aggregate target that Ray Wenderlich told me to create and then readded the framework to my app. After attempting to run my app anew with the revised framework I was shocked to find that I was getting the same error. This makes no sense to me because I deleted the problem variable from the problem file, but it still thinks that that class is referencing that variable. After trying every possible combination of cleaning and rebuilding things, I have inferred that somewhere the very first iteration of my framework is still stored in my app. I cannot find it to replace it. If anyone could help me figure out the best way to cleanly make an edit to my framework and add the new framework to my app I would be very grateful.

jeremyabannister
  • 3,796
  • 3
  • 16
  • 25
  • If your framework is right when drag your own framework in to your app. You need setting BuildSetting -> Framework Search Paths to your relative path of your framework dir (like $(PROJECT_DIR)/Libs , that mean Libs is your framework folder). And add framework to Build Phases->link Binary With Lib. I realy work alot with framework and I hope that help you – larva Aug 04 '14 at 03:26
  • No that's not the problem, my custom framework resides in the same place that all of the other frameworks do (like UIKit and Core Location). My app has no problem finding the frameworks. My suspicion is that Ray Wenderlich's bash script that he instructs us to put in the run script section of the build phases of the aggregate target is where the problem is. It doesn't seem to be actually replacing my Framework on my desktop with the revised version when I rebuild it – jeremyabannister Aug 04 '14 at 05:00

0 Answers0