I’m trying to use the ConnectionKit Framework https://github.com/karelia/ConnectionKit with my application but can’t figure out how to add it as a framework to my XCode project. What is the proper way to add the files as .framework to a project?
Thanks.
First, open the Framework project and compile it for release if you got it as source code.
Then you need to perform three steps in your application project: add it to the project, make the executable link to it and add it to the executable bundle (otherwise the application will only work on your computer).
In project view, expand Frameworks and then Control-click or right-click “Linked Frameworks” and select Add->Existing Frameworks. In the resulting dialog, you will get a list of the Apple frameworks and a button for locating others: use it and select your framework, it will be under …/FrameworkProject/Build/Release.
The second step should already been done alongside the first if you have added the framework to Frameworks\Linked Frameworks, but check it nevertheless. Go to Targets\YourExecutable and expand it, then expand “Link Binary with Libraries”. The framework should be there, otherwise use drag and drop from Frameworks\Linked Frameworks in your application project to “Link Binary with Libraries”.
Now right/control click your executable in Targets and select Add->New Build Phase->New Copy Files Build Phase. A property sheet for the phase will open, the topmost field is a “Destination:” dropdown that will read “Resources” by default, change it to frameworks and close the window. Now drag and drop the framework from “Frameworks\Linked Frameworks” to “Targets\Your Executable\Copy files”.