Marcelo's Blog

contact [at] marceloc [dot] net

Xcode 4 Installing/Linking Custom Framework

leave a comment »

This a working recipe for installing a custom framework and linking it from another project using Xcode 4.

It doesn’t look beautiful, but whatever.

Let’s say your framework is called CustomFramework.

Go the CustomFramework Xcode project and click on CustomFramework on the top of the left pane. Click on the CustomFramework target and then in the Build Phases Tab. Click in Add Build Phase (bottom right) and then in Add Copy Files in the submenu that appears. Se the destination to Absolute Path and type “/Library/Frameworks/” (without quotes) in the Subpath field. That tells Xcode to install your framework in the folder /Library/Frameworks/. OK, build the project. If Xcode tells you don’t have permission to install the framework, go the folder /Library/Frameworks and change your permissions (via Info panel or Terminal/chmod). OK, done with the CustomFramework project.

Now suppose you want to use CustomFramework in your App project.

Open the App Xcode project. Open Finder and go to /Library/Frameworks. CustomFramework.framework should be there. Drag CustomFramework.framework to the left pane of the App project, under the Frameworks section. When asked, tell Xcode you’d like to copy the files to the project folder if needed (I tried telling no to this question but it didn’t work).

That should be it. If you know of a better way, please write on the comments area. If you’re friends with Apple, please let them know there should be a easier way of doing this.

Written by Marcelo

October 9, 2012 at 12:37 PM

Posted in Coding, Hands-On

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: