Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:03:03+00:00 2026-05-31T03:03:03+00:00

I have a bunch of code in an iOS project (named MyLibs) I re-use

  • 0

I have a bunch of code in an iOS project (named “MyLibs”) I re-use across different apps. I drag the MyLibs project into the workspace of whatever app I’m creating. I don’t use unit tests per se, but I have buttons than run through all the tests very easily in the iPhone app.

I’m learning Cocoa and would like to divide up my library into libs I can use on both projects. I was thinking it would be MyCommonLibs (or MyFoundationLibs), MyIOSLibs and MyCocoaLibs.

However, when creating a new project, I must choose between an iOS app or a Cocoa app. It looks as though the iOS Framework and Library -> Cocoa Touch Static Library is appropriate because it links against the Foundation framework. On the other hand, I’d prefer to use an application template if there is no major drawbacks to it.

I need to be able to use MyCommonLibs in both app types, as some of them are useful to both, such as NSArray categories, etc.

Which template should I use for the MyCommonLibs and must I use a Library, Framework (in the Mac OS templates) or can I just use a normal application template (as I’ve been doing thus far)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:03:04+00:00Added an answer on May 31, 2026 at 3:03 am
    1. Create an iOS Framework & Library project. Let’s call it TestLib.

    2. Add a new target (File > New > Target) of type MAC OS X Framework & Library.

    This way, you can compile both an iOS library and a MAC OS X library from the same project.

    You can choose which files are included in each target. So if you want to make a class available for both iOS and MAC OS X, you add it to both, and if you want to make it available for only one platform, you can add it to only one lib.

    As you can see in the screenshots below, SharedClass is available in both libs, iOSOnlyClass is available for iOS only and MACOnlyClass is available for MAC OS X only.

    enter image description here

    enter image description here

    You can also add targets for unit tests in the same project.

    To organize your code, you can put the shared classes in a group, and the classes of each target in a separate group.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of code of the form: someVector.push_back(Foo(some name, 1.0, 3.1415926); someVector.push_back(Foo(different
I have a bunch of code that has lots integers with different meanings (I'd
I have a bunch of generic code that is used a lot, which i'd
I have a bunch of PHP code that is auto-generated and it puts all
I am fairly new to C++ and I have seen a bunch of code
I have a bunch of old C code, which I compiled using MinGW, and
I have a bunch of these little bits of HTML code repeated over and
I have a bunch of occurrences of this kind of boilerplate code in my
I have a bunch of Workflow foundation 4.0 RC code activities that consume web
I have an application with some bunch of code like this: errCode = callMainSystem();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.