I added my project and Kal Calendar's project

2019-09-08 09:22发布

问题:

I tried adding the static library to my project but it wouldnt work. Now, I have resorted to creating a workspace with both Kal and my project. I made a simple UIViewcontroller class, and simply placed import "Kal.h" in my .h file. It won't even recognize it.

What are the steps for creating a proper workspace? I must be missing something, because I though you could share classes in a workspace?

Thanks

I also messed around with schemes and added Kal as a target for my project

回答1:

Actually I ended up getting the static project to work with my project.



回答2:

In XCode 4 click on your project in the project navigator. Say add files to project and find the Kal.xcodeproj. file and add it. When you see the Kal Project under your project you are almost there. Now again select your project in the project navigator and go to build settings. there search for "Linker" and fill in Other Linker Flags: "-Objc and -all_load", also insert the path to the Kal directory in the Library Search Paths and the relative path from your project to the kal project under: "Header Search Paths". Thats it for Build settings.

Now go to Build Phases: Add the Kal static library to the target dependencies, also add the libKal.a to Link Binary with Libraries and at the end add the Kal.bundle to "Copy Bundle Resources".