Can I develop my own objective-C Framework for Cocoa Touch Applications?

前端 未结 9 1085
抹茶落季
抹茶落季 2020-12-13 07:03

Is it possible to create an own obj-C Cocoa Touch framework which can be used by other developers? And furthermore can you protect this framework?

相关标签:
9条回答
  • 2020-12-13 07:41

    I've created templates for Xcode 4 that allow you to build universal iOS frameworks (which work in both device and simulator).

    Once the templates are installed, you simply select "Static iOS Framework" when creating a new project and it does the rest. It also works with unit tests.

    https://github.com/kstenerud/iOS-Universal-Framework

    0 讨论(0)
  • 2020-12-13 07:45

    Yes you can create frameworks for use with Cocoa Touch.

    However there are these caveats:

    1. has to be a statically linked libary, no dynamic loading (dyld) for us
    2. should be a combined (lipo) library for i386 (simulator), arm6 and arm7
    3. you need to hack a bundle project into a framework
    4. you should embed (small and few) images into the library so that the developer does not have to mess around with resources but just drags/drops it into his project
    5. ... or if you have large and many images build a bundle with these

    I have guides for these things on my site.

    1+2 = http://www.drobnik.com/touch/2010/04/universal-static-libraries/

    The other links you have to google because this site does not let me post more than one URL.

    0 讨论(0)
  • 2020-12-13 07:45

    If you're going to do it, in my opinion JSON.framework is a great example to follow. To hide/obfuscate the source code is a different story, and a different question entirely,

    0 讨论(0)
  • 2020-12-13 07:52

    It's unlikely this will work the way you want it to because the other developers won't be able to use your framework. This StackOverflow Question explains why.

    0 讨论(0)
  • 2020-12-13 07:54

    You could make a static library available as binary (i.e. rudimentary "protection") to third parties, but not a dynamic one, as Apple's App Store policy prevents dynamic linking.

    0 讨论(0)
  • 2020-12-13 07:55

    When creating a new project, navigate to iOS > Framework & Library > Cocoa Touch Framework, it's as simple as that. When you are successfully compile, .framework will be created under Products folder in XCode. Right click to show in Finder, and you can find the output.

    0 讨论(0)
提交回复
热议问题