jverkoey / ios-framework Goto Github PK
View Code? Open in Web Editor NEWHow to create, develop, and distribute iOS Static Frameworks quickly and efficiently
How to create, develop, and distribute iOS Static Frameworks quickly and efficiently
I want to create an A.framework that uses B.framework (for example AFNetworking).
Then I have an App that already uses B.framework, I wonder if it is possible to not include the B.framework twice.
What is more, is it also possible to create the A.framework and force the user to include the B.framework?
Thanks.
is there any other way to make a delegate in framework which will be used by third party application for callbacks.
Hi
I have an inquiry on debugging the third-part application that contains our framework.
After adding the framework to the third party,
when I am running the simulator on debug mode and use the F5 to go into the functions I can see the .m files of my lib.
So technically one can see my code.
Can I block my users from debugging and by that browsing my files inside my lib ?
Cheers
In your build settings instructions, you recommend copying the headers to a uniquely named folder, such as "${PROJECT_NAME}Headers". But that folder doesn't exist. Adding a new build phase to create it before the copy is convenient. Might even be worth defining an additional shell variable used by both so they don't get out of sync.
Some extra explanation of the value of copying the headers in the library build target might be informative for some people. Headers in a framework which refer to other headers should use the framework or library #import style "<FrameworkName/ClassName.h>".
Some library developers, rather lazily, use search path-relative paths in their #imports in interface files. Such imports won't work for projects which use the framework. Of course it's fine to use project-relative paths in implementation files.
It might also be worth noting that frameworks use a flat layout for headers, all located in the same folder, unlike a lot of system-style include folders which have sub-folders.
Hi,
I created an SDK framework and it is used by many apps for over a year now. Since 2 days ago 2 of my users complained their apps were rejected for using UIDevice's uniqueIdentifier and it leaded to my SDK.
The SDK does not call "uniqueIdentifier", but it does use UIDevice. It seems that Apple search for the string "uniqueIdentifier" in the *.a file and it is found there. It will be found in the *.o file as well because of the static linking.
Is there a way to build the framework not including depended files from native iOS frameworks?
Thanks,
Gil
Hi, thanks for the great documentation about how to create a framework. I was just wondering.. have you successfully put storyboards into a bundle? We've create a bundle containing nibs ok but I can't get it working with storyboards..
Many thanks
Following your steps I created a project but noticed two things I don't know what to do.
My Xcode has Version 4.6.2 (4H1003).
Can you see what went wrong?
EDIT
So I found something out.
It seems that at least under Xcode Version 4.6.2 (4H1003) the template the the static library has changed.
The workflow you describe is not valid anymore.
To make it work I did the following changes.
// Link the "Current" version to "A"
/bin/ln -sfh A "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current"
/bin/ln -sfh Versions/Current/Headers "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Headers"
/bin/ln -sfh "Versions/Current/${PRODUCT_NAME}" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}"
// new
mkdir -p "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers"
// The -a ensures that the headers maintain the source modification date so that we don't constantly
// cause propagating rebuilds of files that import these headers.
// changed
/bin/cp -a "${BUILT_PRODUCTS_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
// old, copied from serenity. NOTE that the Script on the readme differs as well.
cp -a "${BUILT_PRODUCTS_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers"
With this changes it is working for me. As I'm quite new to this I am not sure if it is a general solution.
Thanks anyway for this idea. I used the kstenerud / iOS-Universal-Framework before and switched now to your solution.
Following the instructions I have managed to create a .framework that can compile for an armv7 device and for the simulator but the fat binary does not include armv7s. I get the following error when trying to use the .framework.
file is universal (2 slices) but does not contain a(n) armv7s slice:
In my static target I have the armv7, armv7s
as architectures. In valid architectures I have armv7 armv7s i386
.
Can someone let me know what I am missing?
Cheers
I added a framework i have created following the guide, but i get an error Framework not found.
I tried adding the framework both by dragging it into the project and by linking it through build phases. I also tried adding the serenity framework to my project but received the same error.
The only project that worked was the third party project with the framework already added.
the log I receive is
Ld build/Debug-iphonesimulator/trackerTrial.app/trackerTrial normal i386
cd /Users/ronenharati/Applications/trackerTrial
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/ronenharati/Applications/trackerTrial/build/Debug-iphonesimulator -L/Users/ronenharati/Applications/trackerTrial/../../Downloads/jverkoey-iOS-Framework-7797eaf/sample/Serenity/build/Debug-iphoneos -F/Users/ronenharati/Applications/trackerTrial/build/Debug-iphonesimulator -F/Users/ronenharati/Applications/trackerTrial -F/Users/ronenharati/Applications/trackerTrial/../../Downloads/jverkoey-iOS-Framework-7797eaf/sample/Serenity/build/Debug-iphoneos -F/Users/ronenharati/Applications/trackerTrial/Serenity.framework -filelist /Users/ronenharati/Applications/trackerTrial/build/trackerTrial.build/Debug-iphonesimulator/trackerTrial.build/Objects-normal/i386/trackerTrial.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework Serenity -framework CoreGraphics -framework UIKit -framework Foundation -o /Users/ronenharati/Applications/trackerTrial/build/Debug-iphonesimulator/trackerTrial.app/trackerTrial
ld: framework not found Serenity
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any help will be appreciated, thanks.
Hi there,
This framework guide is excellent and has taken us really close to our goal for our particular project, so thank you for that.
We are experiencing a slight problem; we want to create storyboards in the framework and use these in the "main" project. We are including the storyboards into the bundle which goes up to the main project. We can call the storyboard and see it in the app when it is built, however we can not include a view controller. Xcode will say it cannot find the view controller.
The view controller is also sat within the framework and imported into the project at build stage, however there seems to be a disconnect between the storyboard and viewcontroller when one is being submitted via a bundle, and other through the standard import procedure.
We've attempted adding the view controller to the bundle, however it does not like this as it will not allow the .h file into a bundle. I have also tried inverting the dependencies so the framework becomes a dependency of the bundle (thinking was that it would cause all the classes therein, inc viewcontroller, to load first).
I wondered if this is something you have encountered on your work on frameworking, and if so if you know a fix.
Many thanks,
Chris
Hi Jeff,
Thanks for this framework and well-documented.
I'm following your guide, until I've reach the "Adding the Framework to a Third-Party Application".
My case is that I've created Xcode workspace, added the Framework project (ex. Serenity), then, I've also added the 3rd-party project (ex. Demo1)
But then, how can you add the .framework as dependency to the 3rd-party project? I think dragging the .framework is less ideal.
Pls. have a look on these screenshots:
http://tinypic.com/r/f5b0ic/5
http://tinypic.com/r/jkcbp1/5
Pls. let me know your thoughts. Thanks
In my framework I need use a single png image file. For that single image I need to create a resource bundle and distribute it along with the framework. Also the user can open the resource bundle and change the image inside it with their own image. Is there anyway I can embed the image file inside the framework itself ?
Great instructions for framework creation. This was driving me crazy until I followed the steps you lay out.
I'm having problems referencing the contents of my bundle from within the framework itself. The bundle directory generated has the resources (a couple of .wav files) but when I execute the method "frameworkBundle" it first gets the main bundle path and then looks up my target bundle from there. The problem is that the main bundle path, on my system, is
/Applications/Xcode45-DP4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/Developer/usr/bin
The location of the generated bundle directory is
/Users/kevan/Library/Developer/Xcode/DerivedData/VoiceRecognizer-gspaqmheqchgdidaxgbqjpbrwcpp/Build/Products/Debug-iphonesimulator/VoiceRecognizer.bundle
(VoiceRecognizer is the name of my bundle and framework).
Any tips here? I didn't see anything in your steps to do anything to add the bundle to the main project.
I should say that this problem occurs when I run unit tests against my framework.
I'm replacing my earlier comment here with a much simpler formulation of the problem, which can be reproduced with the supplied sample project framework Serenity, using XCode v4.4.
The problem is that when I add armv6 to Architectures, the build fails with the following, during "Build Framework" script. Everything is fine if I stick to just armv7, but I need a fat library.
=== BUILD NATIVE TARGET Serenity OF PROJECT Serenity WITH CONFIGURATION Release ===
Check dependencies
No architectures to compile for (ARCHS=armv7 armv6, VALID_ARCHS=i386).
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Command /bin/sh failed with exit code 65
Hello,
I was able to framework~ize my project thanks to the instructions in this github project!
I broke up my ElasticSearchClient into:
https://github.com/pulkitsinghal/ESClient
https://github.com/pulkitsinghal/ESClientDemo
iPhone and Simulator builds don't give me any trouble but when I try to archive a project which has been setup according to "Developing the Framework as a Dependent Project" instructions, I run into some issues with the last copy statement of prepare_framework.sh:
Cp: /Users/pulkitsinghal/dev/myapp/DerivedData/MyApp/Build/Intermediates/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/ESClient/Headers/: No such file or directory
I don't know why this pops up as a problem for only the Archive process. Can someone help?
I'm not saying that there is something wrong with iOS-Framework
, I'm simply asking for some help to do more with it :)
Hello All,
I want to create framework with several localizations. Could you please recommend a way how to do it?
P.S.
I think I can put Localizable.strings into bundle but I guess NSLocalizedString will not work. Is it correct?
When I selected "Product" -> "Archive", I got a build error:
Run custom shell script "Prepare Framework":
cp: /Users/xxx/Library/Developer/Xcode/DerivedData/Serenity-gmlshjiqdgnramdrwviyvmxhjqqk/Build/Intermediates/ArchiveIntermediates/Serenity/BuildProductsPath/Release-iphoneos/SerenityHeaders/: No such file or directory
I checked the "Prepare Framework" source code:
cp -a "${BUILT_PRODUCTS_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers"
It seems that "${BUILT_PRODUCTS_DIR}" is not the right path which leads to "SerenityHeaders".
Thanks for your time!
Hi,
I have created a couple of View Controllers that should be a part of the Framework and bundle that I ship. So while creating the ViewController, I specified that it should be part of Resources and MainProject.xcode
While building the package, the Resources file shows an error saying Cocoa/Cocoa.h not found in Resources-Prefix. I believe its because of the view controller. So could anyone suggest if there's a way to fix this OR if there's any other way that I can incorporate view controllers into my framework. Essentially I want a few views to display over the other app's view, i.e., if a developer includes my framework and sets itself as the delegate, my framework should add a subview over the delegate's view.
So I am planning on designing this subview in Interface builder and then incorporating it in the Framework.
I'd much appreciate an early Reply
Thanks
I'm trying to use this approach to build my own framework, but I need to use some other static libraries (.a) in the framework code and it fails at link stage when building the application project that use this framework. Is there any specific thing I should do with the .a files in the framework in order to them being included in the final .framework file?
Thanks!
Hi,
I am getting an unrecognized selector error when I import a category inside Serenity.h and run the ThirdParty app. The dependant app runs fine without any error though. I tried the following two ways of importing but none of it seems to work.
ThirdParty[22436:707] +[UIColor colorWithHexString:]: unrecognized selector sent to class
Any pointers to how I can make this work?
Thanks,
Karthik.
I have a need with my framework to allow debug symbols. To date I have tried the build settings of:
DEBUG_INFORMATION_FORMAT: DWARF with DSYM file
STRIP_STYLE: Non-Global Symbols
Dead_Code_Stripping: No
Deployment Postprocessing: Yes
Generate_Debugging_Symbols: Yes
None of these produce the .DSYM file with the framework, which I suspect is a bug.
I tried to add a catagory of UIImage. There is no building error or warning. But when running, the application crash with a error said "[UIImage imageInBundle] class can not response to the selector". I think the catagory is not added to the framework, weird.
I've been trying to nest frameworks as you would static libraries. My use-case is that I want to produce a monolithic framework that's composed of several private frameworks, e.g.
...and then use that framework in a dependent app:
Is there a way to get Xcode to link the dependency frameworks into Public
(like ordinary static libraries), so that they do not need to be linked in DependentApp
?
XCode 4.5 doesn't seem to allow you to change the target membership visibility of files:
Someone asked about this on stack overflow: Can't change target membership visibility in XCode 4.5
The only response to the question was a suggestion to create a Copy Headers build phase.
I'm trying to build an ad-hoc build for a client that uses the iOS-Framework (via sub-project inclusion of the actual framework project, not the static library, since i'm developing the framework in tandem with the project).
Building and running works fine until you try to use Product -> Archive. In that case it fails during the PrepareFramework task when copying headers. For some reason, "${BUILT_PRODUCTS_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" does not exist when you using Product -> Archive.
Do you have any idea how to fix that?
I'm building this framework using two ways :
When building from xcode everything is fine, but when building from jenkins the shell script fails and i'm getting the following message :
"Could not find platform name from build products directory: /Users/X/Desktop/workspace/Project-Name/build"
I tried to echo the $BUILT_PRODUCTS_DIR and $SF_SDK_PLATFORM vars, and when using the CI tool i get something like :
BUILT_PRODUCTS_DIR = /Users/X/Desktop/workspace/Project-Name/build
SF_SDK_PLATFORM = iphoneos
whereas from Xcode i'm getting this :
BUILT_PRODUCTS_DIR = /Users/Y/Library/Developer/Xcode/DerivedData/Project-Name-bzuxlzzqgtqufzfofmkedmdiphnm/Build/Products/Release-iphoneos
SF_SDK_PLATFORM = iphoneos
I assume it is the "CONFIGURATION_BUILD_DIR" xcodebuild parameter which cause the problem, since i can't build in the same place in my CI tool, but i don't know how can i change the script to make it works in any case. I would like to do not hardcode some vars.
PS : I can't change the script executed in the CI tool to make it use BUILD_DIR instead of CONFIGURATION_BUILD_DIR
Hi, I've been trying to follow the instruction for framework building using Xcode 5 & iOS7. It seems the "prepare_framework.sh" and "build_framework.sh" script are not running properly. wonder if we could have an update on this ? Thanks
Hello,
I followed your guide, but i'm having little problems of duplicate symbols, any idea ?
More precisely, i'm having the issue when i try to build a dependent project. If i build the framework project only i don't have the issue.
Thanks for you work :)
I've created framework and successfully distributed it to developers. But at some day I received a feedback with crash file from my code inside framework. There was one confused thing regarding to paths in that log file, for some reason everyone can see absolute path from my machine. How can I change path in order to developer can see only last part (e.g. not to show /Users/MyUser/Work... only LineFramework/Classes/ or even LFEventManager.m)? Should I apply some changes in the script or is this just an option in the project settings?
Example:
....
#11 0x348eaf78 in _PF_FulfillDeferredFault ()
#12 0x348fcf9e in _sharedIMPL_pvfk_core ()
#13 0x00279f66 in -[LFEventManager performEvent] at /Users/aberkunov/Work/Current Sources/iOS/LineFramework/Classes/LFEventManager.m:36
#14 0x0027141a in -[LFDataBase loadEvents] at /Users/aberkunov/Work/Current Sources/iOS/LineFramework/Classes/HttpClient/LFDataBase.m:116
....
In Xcode 4.5.2 I had to make some changes:
/bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
TO
/bin/cp -a "${TARGET_BUILD_DIR}/include/${PRODUCT_NAME}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
Hi
When I import the images directly to the thrid-party project and try to stretch it using "stretchableImageWithLeftCapWidth"
all is good.
but when I am trying to get the image from the bundle we created in the guide - it looks corrupted.
This happens only on stretching ...
is it possible that somehow the image is uploaded wrong.
Note: it happens only on ios 4.X and in ios 5 it looks good.
Any ideas ?
Best regards
I downloaded the sample and tried to build everything is perfect, except when I build for Archiving, it fails giving me an error like this
Cp: /Users/amr/Library/Developer/Xcode/DerivedData/DependentApp-bpcugixqkrtyccfhtjedaeztmgvd/ArchiveIntermediates/DependentApp/BuildProductsPath/Release-iphoneos/Headers/: No such file or directory
Is anyone else having issues with Bad Instruction: 4 crashes when deploying an app based on these iOS frameworks to the device via an IPA?
The crash only happens when you archive the app, sign it, and install it on the device. It does not occur when compiling for Release, or otherwise when it's convenient for the debugger to catch the problem. I'm spending hours on hours archiving, signing, installing the IPA, and symbolicating the resulting crash logs with hundreds of NSLogs for any debugging info. I'm drowning.
From what I can gather from several stack overflow posts, it would seem that it has to do with running any static C functions in sub-libraries.
So my application workspace and frameworks (via dependency) look like this:
Application Target:
An "app plugin" as a framework
Common/Core utility framework
Custom UI element framework
Custom UI Shell/Environment framework
Security and Authentication framework
Network and Data framework
-- RestKit as a framework (inside the network and data framework, in order to keep it unexposed)
All the frameworks have the same build settings. All of the frameworks are executing code successfully before the crash. Some of the RestKit framework methods work fine too, but it's a few seconds into the startup that it dies while mapping some JSON to Core Data (not all JSON to Core Data is problematic though, it's already mapped some successfully before the crash).
Jul 31 04:13:48 unknown ReportCrash[11834] <Notice>: Formulating crash report for process Fusion Tap[11830]
Jul 31 04:13:48 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.oraclecorp.internal.Fusion-Tap[0x704a]) Job appears to have crashed: Illegal instruction: 4
Jul 31 04:13:48 unknown SpringBoard[23] <Warning>: Application 'Fusion Tap' exited abnormally with signal 4: Illegal instruction: 4
Jul 31 04:13:48 unknown ReportCrash[11834] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Fusion Tap_2012-07-31-041347_Spooky-Mulder.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Add the framework that has worked in Xcode 4.x, and try to run in Xcode 5, only to run into this error. How can I build my framework to include arm7s support?
ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/my_name/Desktop/Folder/ExampleApp/Library.framework/Library file '/Users/my_name/Desktop/Folder/ExampleApp/Library.framework/Library' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I select the aggregate target's scheme and choose Product > Archive, Xcode goes through the motions of building but nothing appears in the output. The Organizer window doesn't open, and the archive doesn't show up in the list in the Organizer. There is an xcarchive file in the Archives directory, but it's empty. There's also what appears to be a built framework in build/MyFramework/Build/Intermediates/ArchiveIntermediates/MyFramework/BuildProductsPath/Release-iphoneos/ .
On the other hand, if with that scheme selected I choose Product > Build For > Archiving, my project's build output directory does contain a Products/Release-iphoneos/MyFramework.framework.
Of course I can use that as a workaround, but I'd rather that the Archive command worked normally, both to avoid confusion and because it produces a nice timestamped series of release directories.
Hi
First of all, thank you for sharing this, and thank you for writing this guide.
I have a small question about the framework's build time.
It took me more then 30-50 min building my framework (usually regular build takes me about 5 min when I built it for a specific target , simulator or device).
Any advise on that issue.
Thanks
Itay
jverkoey/iOS-Framework seems to get you 90% of the way, in regards to making a nice .framework for iOS to distribute to third-parties.
But what if you're distributing other third-party SDKs in your .framework? Is there a way to include .a, .framework, and other .dylib files that these other third-party SDKs have, directly into your .framework?
Is it possible to have other third-party frameworks wrapped by the framework that you create, as outlined in this project that may have things like:
So that devs using your framework, wouldn't have to manually add .a, .framework, and .dylib files from the third-party libraries your framework wraps?
I'd love to be schooled in why this is not possible, if so, for each of those files.
Resources:
Also posted here, hoping to get more feedback/answers on StackOverflow: http://stackoverflow.com/questions/19968157/ios-frameworks-ways-to-make-this-better-when-having-other-third-party-librarie
I've seen multiple people having faced this problem. I have no clue how to proper build my framework for release, debug seems to be working fine. Once I build a release with the project that is using my custom framework, it show that error.
No I've seen that Build Active Architecture Only is set to No in my Aggregate Target.
I'm using the play button to build when I have the target selected (is this the right way to "export"), and it's located in "Debug-iphoneos" and "Debug-iphonesimulator" nothing in any release folder.
And I'm using the library simply by dragging the .framework folder + .bundles to my project.
Could you help me out?
Hey,
Followed the steps in this tutorial with Xcode 4.5 and discovered that if deleting Serenity.m and trying to build, the libSerenity.a would not be built (could not show in Finder and if manually going to derived data it would not be there either. Not sure why this is, any explanation?
Hi,
that's not a real issue with your frameworks style, but it is a problem during the workflow with them.
Say we have this scenario:
App --> Framework 1 --> Framework 2
--> Framework 2
It's a good practice to link everything into the app (you could see issue both with duplicate symbols and mysterious BAD_INSTRUCTIONs).
The problem is that app should build and link Framework1 and Framework2, but Framework1 should only import Framework2 headers.
I thought it should be ok if Framework1 only builds Framework2 without linking (to create .framework) but it's not the case: Xcode often makes confusion parallelizing builds, choosing the deepest build (with git submodules it could choose an old version...). What is more (the real problem) the #import <lib/header.h>
could fail, because of crossing dependencies.
I circumvented this problem manually copying a reference of Framework2 headers in Framework1, adding a Copy Resources phase to Products Directory/AFolder/Framework2. So, I can set Header Search Path to this folder and #import <Framework2/Framework2.h>
still works.
This workaround is ok, but everytime I add a public header to Framework2 I mess up Framework1.
Do you have a pretty idea to solve this problem? Maybe a cool script which automatically copies public headers of Framework2? :)
Hi ,
Thanks for this awesome framework.
we tried to compile our framework to iOS7 but it failed for iOS7 64 bit.
can we know any settings to change in the build arc or script to make work?
Thanks.
I followed the steps and created a framework. In the framework, I made only one header file as public and kept all the other files project level. In the public header file, I have imported some private header files. When I integrate the framework with a project it is saying that the private header files which are imported in the public header file are not found. "Lexical or Preprocessor issue SomePrivateHeader.h file not found". I have to make all the header files public then only it works. Please tell me what could cause this error.
There's another setting to change on the MacOS resource bundle to make it work with iOS retina graphics.
Note: If you don't change this setting, retina graphics will be combined using the utility tiffutil. This means your retina graphics will be missing and won't work in .xib files or when you try to load them programatically.
tiffutil -cathidpicheck myimage.png [email protected] -out myimage.tiff
Solution
In the bundle target's "Build Settings" change COMBINE_HIDPI_IMAGES from YES to NO.
I use this tutorial to build a small framework. I also add some categories to my framework, but when I add my framework to other project and use method from category, it said that "unrecognized selector sent to class". I search question in internet and then I add to Other linker flag "-ObjC", "-all_load" but it still does not work. Please tell me what wrong with my problem. Thanks
Hello,
I'm trying to put a custom font to the bundle but I'm not able to load it.
NSString *fontPath = [[NSBundle frameworkBundle] pathForResource:@"MyCustomFont" ofType:@"ttf"];
NSArray * array = [UIFont familyNames];
I included my font name in the bundle's plist with a "Fonts provided by application", without success, tried also in the app info plist, include it in the framework ressource without success.
I solved with success the loading of nib and images from the bundle (by providing the bundle's name) but not for the font whereas I tried many things. So if someone did it, that that would be great to have documentation.
Thank you for the help !
I am running my framework on the third-party application and it works great.
I have 1 problem with the Three20 project.
Three20 is inside my "Serenity" project,
I thought that when creating the fat-lib it will include the Three20 as well , but I seems to have a problem there.
When running the third party application, it crashes when it gets to the code of the Three20 :
error -[TTStyledBlock findLastSibling:]: unrecognized selector sent to instance
Any idea what can be the problem there ?
Itay
I believe some clarification is needed if you create Foo.framework
which internally depends on Bar.framework
or maybe directly import Bar.h
and Bar.m
, then you might run your users into a problem if you keep things just like that, because someone that depends on your Foo.framework
might also depend on Bar.framework
(exact or different version) for some other reason.
I guess best practice here would be to rename any dependancy class, protocol, enum types, etc. with FOO_
prefix in order to avoid overriding.
Any thoughts on this one?
Thanks.
I tried to build my framework which depends on the Restkit0.20 framework. Installing it in the my static library directly via cocoapods created many problems.
I tried to use a https://github.com/jverkoey/iOS-Framework/#developing-the-framework-as-a-dependent-project and import the Restkit via cocoapods into the dependent app, but I still get a compile time error that he can't find the 'RestKit/Restkit.h' file.
Is there a way to directly include a third party library inside my own library if the third party uses cocoapods?
If not, is there another way to include the restkit library in my library and how exactly would I need to go about this?
Hello everyone:
I followed step by step all the instructions in the README file. I built a simple framework and I linked the .framework to a third party application. In xcode 4.2 is all right but when I do the same in xcode 4.6.3 displays a mach-O linker error that says: "ld: framework not found". My tarjet is build the framework with the amrv7 and armv7s architectures. Can you help me?
Thanks.
Javier Suazo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.