Custom libraries

9 views
Skip to first unread message

Peter Kasson

unread,
May 8, 2013, 11:09:34 AM5/8/13
to ci...@googlegroups.com
Hi group,

I have followed Apple's typical glorious docs on how to create your own static library that you can share amongst several projects, and so far have created this library, with all headers ... so far so good.

When trying to add this new library to another project, this is where I am having issues.  Typically, this is not difficult (unlesss working with old RestKit libs  ;) but maybe I missed a step.

After creating a workspace, the docs indicate dragging the project into the application, requesting this external library and alas, no rainbows and unicorns.

Has anyone bee successful with this seemingly simple task ?

Thanks.

Peter

Christopher Judd

unread,
May 8, 2013, 11:14:53 AM5/8/13
to ci...@googlegroups.com
Peter,

Instead of doing a shared library, you might want to consider doing a http://cocoapods.org/.

--
You received this message because you are subscribed to the Google Groups "Columbus iPhone Developers User Group (CIDUG)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cidug+un...@googlegroups.com.
To post to this group, send email to ci...@googlegroups.com.
Visit this group at http://groups.google.com/group/cidug?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Travis Smith

unread,
May 8, 2013, 11:25:58 AM5/8/13
to ci...@googlegroups.com
+1 on cocoapods. Makes it so much easier. When it works. 

-Travis

Peter Kasson

unread,
May 8, 2013, 11:41:06 AM5/8/13
to ci...@googlegroups.com
Chris,

Thanks for the feedback.  I have used pods, but not sure how to add my OWN library to the Podfile ... I will take a look.

Peter
Message has been deleted

Peter Kasson

unread,
May 8, 2013, 12:24:21 PM5/8/13
to ci...@googlegroups.com
I think I found a great article on how to do this, for those interested ...  it details how to manage private libraries and creating your own pod spec.

Travis Smith

unread,
May 8, 2013, 12:07:04 PM5/8/13
to ci...@googlegroups.com
You can make the source a remote or local repo. 

Shane Zatezalo

unread,
May 14, 2013, 8:44:48 AM5/14/13
to ci...@googlegroups.com, ci...@googlegroups.com
We do this all the time with static lib targets and even frameworks/bundles. It's a real timesaver.

So you have a workspace with projecta in it, and you're dragging in projectb, it's build target being a static lib.

In projecta, you need to edit the build config for it's targets; link against the static lib, add -ObjC to linker flags and possibly alter your scheme to tell Xxode to compile projectB when A is built. You may also take a look at the header paths to make sure you're getting projectb's headers when you build, and also when you archive.

Stop by one our NSCoder or Cocoaheads meeting and we can help you. We did a similar setup for someone wanting Mac app, as well as an iOS app from the same c-based libs during a recent meeting.

 Shane

 http://buckeyecocoa.org/

Sent from my iPhone

Peter Kasson

unread,
May 14, 2013, 9:03:58 AM5/14/13
to ci...@googlegroups.com
Shane,

Thanks for the info ... and I have been meaning to get to one of the Cocoahead meetings ... next one !

I did start down this path, but also wanted to work within the Cocoa Pods zone and have the project included in the typical Podfile manner.

After deciphering the podspec, I was able to get the 'local / git' project added via a pod install.  But ... I see all the h/m files ... and when this is all over, only want to include the library itself and corresponding headers ... so I think I am inching closer.  

Peter
Reply all
Reply to author
Forward
0 new messages