How to make a custom framework

Discussion in 'iOS Programming' started by ace2600, Aug 14, 2008.

  1. ace2600 macrumors member

    Mar 16, 2008
    Austin, Texas
    A few of my apps use the same base code set. I tried turning this shared code into a framework (like I would when creating a Cocoa framework). I ran into this issue: "Target specifies product type '', but there's no such product type for the 'iphonesimulator' platform" when building.

    I saw a similar problem online and someone mentioned:
    "3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple's Published APIs and built-in interpreter(s). " However, this was dated June 10th.

    1) Does the iPhone allow custom frameworks?
    2) If it allows custom frameworks, any ideas on the error above?
    3) If it does not allow custom frameworks, how would you recommend managing the shared code? If XCode supports two SVN repositories for the project, maybe I could checkout the app-specific code and the shared code and changes to the shared code could be reflected in my other apps?
  2. kainjow Moderator emeritus


    Jun 15, 2000

    I don't think Xcode supports more than one repository for one project (that would be confusing).

    If you have shared code in multiple repositories, you will just have duplicates. I'd suggest putting all your projects in one repository, just in different folders. Then you could link in the shared code to all projects.
  3. tacoman667 macrumors regular

    Mar 27, 2008

    Are you sure about this? GData, entropydb, and many others claim that their frameworks will work in the iPhone projects.
  4. Palad1 macrumors 6502a


    Feb 24, 2004
    London, UK
    Have you tried svn externals?

    MyLib root : checked in svn://myserver/MyRoot/MyLib

    MyApp root checked in svn://myserver/MyRoot/MyApp

    declare an svn-external property in MyApp/trunk/lib named MyApp pointing to MyLib/trunk then update / commit... voila!

    watch out when branching and merging, you have to start by working on the externals first, then change the svn-external property to point to the branch/trunk created/merged.

    Have fnu!

    ps: having externals pointing to a trunk is a bad idea, you want to point to a 'fixed' version such as /release/v1.2.3 so you don't get totally screwed if someone else changes something in the trunk... you won't see the external updates in detail and may miss important info in the svn log.

    pps: anyone knows how to decode mp3 / access the iTunes library from an iPod touch app?

  5. kainjow Moderator emeritus


    Jun 15, 2000
    They probably mean for you to add it into your project. From the iPhone SDK agreement:
    It's not possible (to access the library) using the public SDK.
  6. ace2600 thread starter macrumors member

    Mar 16, 2008
    Austin, Texas
    Thanks for the help.

    I'm not tied to any source code management software right now. I wanted SVN because I've used it in the past and its integration with XCode. After looking at my needs and svn externals, I'm going to try Git for its superproject/submodule feature.

Share This Page