Converting Framework to a Library - iphone

I want to use the framework found at the link below within an iOS app. I have it working within the simulator but after some digging it looks like you are unable to use frameworks on devices and especially when distributing through the App Store. Please correct me if I am wrong.
https://github.com/mirek/YAML.framework/
How would I go about converting this framework to a library? I have looked at simply dragging the files from the framework to the app which doesn't work.
Thanks in advance.

It's super easy.
Give the general iOS static framework structure:
3rdPartyLib.framework
|---3rdPartyLib -> Versions/Current/3rdPartyLib
|---Headers
|---Resources
|---Info.plist
|---SomeBundle.bundle
|---Versions
|---A
|---Current -> ./A
You have to
1) Copy the static library file in a new folder
3rdPartyLib.framework/Versions/Current/3rdPartyLib
2) Rename is with .a extension and copy to a new folder
3rdPartyLib/
|---3rdPartyLib.a
3) Copy all the headers in the folder
3rdPartyLib.framework/Headers
in a new headers folder in the new folder
3rdPartyLib/
|---Headers/
At this point you should end up with
3rdPartyLib/
|---3rdPartyLib.a
|---Headers/
This is your static library that you can use within your app or within another iOS framework to be distributed to other apps.

Take a look at this: https://github.com/Ecarrion/YAML.IOS
Just grab the YAML.Framework folder
And you actually can use framework, you just can't use dynamic libraries.

Related

Use Private FRamework in Xcode Celestial

I'm a Xcode beginner so I would really appreciates if the answers were as much detailed as possible (if image could be included it would be best)
I would like to use the celestial private framework, I do not care if it get rejected by the app store since it's a private project.
I would like to use the AVSystemController in the celestial framework.
If I go to the xcode directory, I find only an exec file in the framework.
I found the headers files at:
https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-
download:
https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-/archive/master.zip
The questions are:
1-Do I add the framework that's included in the xcode directory the one that has only on file (exec named Celestial)? or should I add a headers folder first and put all the downloaded headers in it?
2-IS Github a trusted site? btw I couldn't help but noticing that the downloaded zip file headers (at least the AVSystemContriller.h ) are different then the ones you directly open on the website
3-After adding the the celestial framework (in the linked Binary with librairy of the project ) to use it I should use #import but I get an error not found
The purpose of this project is to turn the iphone to silent profile by code.
Please Help, I've been reading threads all over the internet and I wasn't able to solve it.
P.S.: Like I said before I am a beginner so it would be appreciated to detail you answer as much as possible
Thank You
dumping private header is for helping you to find functional without documentation, to load private framework you just type on your code like this :
NSBundle *b = [NSBundle bundleWithPath:#"/System/Library/PrivateFrameworks/WhatEver.framework"];
that mean, you will load/use private framework at your iDevice :)

How to build a static library of an existing project in objective-c (.a file)?

I want to make .a file means static library of my project which I have made. How can I achieve this. Please provide me the the best solution, tutorial or any other links.
Thanks in advance
http://mobileorchard.com/sharing-compiled-code-building-static-libraries-in-xcode-for-the-iphone/ has a good tutorial.
Here are the basic steps:
Understand that XIB/NIB/Storyboard files have to be included separately from the library
Add a new target that is a static library
In the build settings for that library, include all of the .h and .m files that are relevant. For example, if your app uses a set of classes to access data and another set to view that data, you may want to just include the files relevant to accessing data.
Build. Use the script provided at Build fat static library (device + simulator) using Xcode and SDK 4+ so that you can use it for iPhone simulator + device.
Include your library + headers + any resources in relevant project.
With xcode4.2, easiest way is to new project, iOS/Framework & Library, CocoaTouch Static Library, and add all you files existed.
Here is the easiest tutorial with which i have built a static library in iphone. After building a static library you will import a .a library file and the header file .h in your new project and use them. Here is the tutorial link for making static library.

How to unzip a zip file shared through iTunes from the Application Programmatically?

I need to unzip file synced through itunes in the documents directory programmatically. There are open source frameworks available like ZipArchive and ZipKit but I am not able to use them in the project. Is there a decent tutorial where I can see how to use these frameworks.
you can use SSZipArchive.
It is so simple way to unzip file. please read Readme.markdown (usage).
Simple three lines and that's it.
For ZipKit, you need to use the Better Way of Installing the Framework and follow the Static Library section of the ZipKit Documentation because iOS doesn't allow you to use to embed the Frameworks directly. You need to include it as a Static Library.
Alternatively you could use something lightweight like iZip

create our own frame work in iphone

There are lots of the frameworks available for different purposes, but I want to create framework library for my some of my classes -- in that all the .m files are loaded in single .a file and it's used with the list of header files.
Can any one tell me how to create a framework?
This webpage should give you the necessary information when creating your own framework.
http://accu.org/index.php/journals/1594
Hope this helps!
You can create a "Cocoa Touch Static Library" project in Xcode.

importing private frameworks in Xcode

I am a novice iPhone programmer I want to use some of the functions in the private framework
https://github.com/kennytm/iphone-private-frameworks
The function that I want to use is in 'SpringBoard'
So I downloaded 'SpringBoard' folder in that github repo.
And created a subdirectory called "Headers" in 'SpringBoard'
and put all the header files in that folder.
And renamed 'SpringBoard' to 'SpringBoard.framework' and copied it to /Developer/Platforms/(iPhoneOS_and_iPhoneSimulator)/sdks/System/library/Frameworks folder (I can't recall full path correctly sorry)
And I got back to the xcode and right click on Frameworks -> Add existing framework -> other -> I selected 'SpringBoard.framework' folder and clicked Add.
And I built the project and got an error
'ld : framework SpringBoard not found'
My imported framework does appear on the Xcode and I can see header files in it.
but when I built it I got that error.
What am I doing wrong?
Place all of your private headers in a directory like: /User/Name/Headers/ then set USER_HEADER_SEARCH_PATHS = "/User/Name/Headers/" and make sure that ALWAYS_SEARCH_USER_PATHS = YES
Also, SpringBoard.framework is not the way to do that.Simply place the folder named SpringBoard in the above Headers folder, making sure that the headers are directly inside them. For instance: SpringBoard/SBAlert.h
/* SpringBoard is not a framework. */
Notice that you wont have to add the SpringBoard folder to your project, they should appear as you start typing, as long as you set the above headers correctly.
I'm not sure if this works, but here a suggestion:
I think the spring board framework should be in the UIKit framework you already linked anyway, so just add the header file to your project and it should work.
Otherwise this could help you:
http://www.codethecode.com/projects/class-dump/