How to add custom framework in a project? - iphone

I am making an app in which I am using BMSocialShare.framework for Facebook sharing. I have add this framework in my project by this step - Add File to "My_project" -> select framework -> add. But when I deploy this project in another system them I have got this framework
missing and got this type of warning -
warning: Could not find object file
"/Users/vinzenzweber/Library/Developer/Xcode/DerivedData/BMSocialShare-gedvbinixmfywidbwutkdxrdvdzo/Build/Intermediates/BMSocialShare.build/Release-iphonesimulator/BMSocialShareFramework.build/Objects-normal/i386/BMSocialShare.o"
- no debug information available for "/Users/vinzenzweber/Documents/xcodeworkspace/blockhaus-git/BMSocialShare/iOS/BMSocialShare/BMSocialShare/BMSocialShare.m".
and app get crashed. So can you suggest me that what is the proper way to add an framework if framework is not present in our existing list.

You can follow below steps:
1) Create sub-folder in your project and add framework into that folder.
2) Now, open Build Phases -> Link Binary With Libraries. And click on '+' button.
3) Then click on "Add Other" instead of adding default framework.
Now, you have added framework successfully.
That's it.
Cheers!

First copy and paste your frame work in where ever your project location and then do the same task that you have been done this is working
and another thing when ever you deploy this in another system make sure send the project with compress means zip file

Related

Sparkle 10.9 Linking Error

Having an issue where when trying to add Sparkle to my project with Xcode 5 running 10.9.
I have followed the tutorial to a T, but when I get to the point where I need to copy the framework and set its copy location that is where there seems to be no way to set the copy destination in the copy bundle resources section and it just puts the framework int the /Resources folder.
I have ready through this tread thoroughly and have tried all the suggestions here.
http://www.lists.apple.com/archives/xcode-users/2012/Aug/msg00249.html
I recompiled Sparkle from the latest source and set the Installation Directory to #executable_path/../Frameworks from #loader_path/../Frameworks I get the following error.
dyld: Library not loaded: #executable_path/../Frameworks/Sparkle.framework/
when I revert and try to re add the framework I get this error.
dyld: Library not loaded: #loader_path/../Frameworks/Sparkle.framework/
If I remove the framework from the link framework from binaries altogether and just focus on the Copy Bundle Resources then I get this error.
Unknown class 'SUUpdater', using 'NSObject' instead.
The tutorial is written for Xcode 4 I know. One step says to use Copy File Location but that seems to be gone in Xcode 5 any help is appreciated.
UPDATE
I found a work around but its very messy.
Add the framework to the "Add files to build" build step.
Unlink the sparkle framework.
Open Derived Data folder and then open the App Build, then browse to Resources. Move the sparkle.framework folder to the root of the app and place the framework into a folder named Framework in the root level of the app.
Remove the framework from the "Add files to build" step.
Re-Link the framework.
Rebuild the App and voila it works.
Basically your adding the framework in a Framework folder manually and then linking it up at the end. What makes it messy is that the build changes occasionally in the Derived Data folder.
I have the same problem. And I think I have solved it.
It happens because the Sparkle.framework isn't copied to Frameworks folder(where it should be), it is copied to Resources folder when you build the application. To solved it:
Download the source of Sparkle from GIT (https://github.com/sparkle-project/Sparkle) and open the project in Xcode 5;
Go to Build Settings of every targets, then find Base SDK, change the value to macosx.
Go to Sparkle.framework's Build Settings. Find Installation Directory, Change its value from #loader_path/../Frameworks to #loader_path/../Resources under Sparkle.framework's Build Settings.
Build.
Copy Sparkle.framework under Products group in Project Navigator to your project.
Say YES and take a self highfive.
I was suffering from the same problem, then I found this:
http://www.lantean.co/sparkle-in-sandbox-mode/
The key is to add the Sparkle.framework to the Frameworks folder using the "Copy Files" section from "Build Phases".

RestKit Integration issues "No Such File Or directory"

I am using xcode 4.3.1 and i am going to implement RESTKit to my Project In that follows This Step to integration of the RestKit.
When the Drag and drop the RestKit project to my project it's done but when adding the Link Binary with library then it's red then after restart the xcode then also same problem aries
then after i build the project and shows the Below Error and not Running the project,
and file structure of the my project given below
So any body can help to solve my error,
Thanks in advance for spanding your valuable time.
This is because sometimes you add a file and then delete it. It removes the file from your project but the reference remains there, or it may be that the file was deleted but the reference still exists - go to the Project Navigator > right click > add files to... > and add the file that was red.

Sending email in an iPhone application

I am getting this warning
MessageUI.framework/MessageUI, file was built for unsupported file format which is not the architecture being linked (i386)
What does it say ?
I have added the Message Framework by drag and dropping to my resources folder (I also selected the tick where it says copy the files or something). Is this the correct way to add a framework ? I tired R-clicking the resource folder, but I couldn't find any menu option that says add framework or anything similar. (I am using xcode 4.2)
you should add the framework through target setting, under build phases, under link binary with libraries, add messageUI.framework there, DO NOT drag and drop and COPY into the resource folder.
You have to manually add MessageUI framework in your project.
To do that follow this step:
1) Click on your main project --> Go to Target ---> Select Build Phases --> Select Link Binary With Libraries.
2) Click on + sign and add framework named MessageUI.framework.

How to integrate RestKit Framework (restkit.org) with xCode 4?

I followed the instructions on the github page but something is wrong (most certainly is me: P) but, Do you know about any good tutorial for integrate / use in Xcode4 RestKit?
Thanks!
Download the latest version from this Link http://restkit.org/
and extract the zip folder and you will find a ReadMe.md file which explains you steps to install for Xcode 4.x as shown below
Xcode 4.x (Git Submodule)
Add the submodule: git submodule add git://github.com/RestKit/RestKit.git RestKit
Open the project you wish to add RestKit to in Xcode.
Focus your project and select the "View" menu > "Navigators" > "Project" to bring the project file list into view.
Drag the RestKit.xcodeproj file from the Finder and drop it on your "".xcodeproj.
Click on your project's name in the sidebar on the left to open the project settings view in the right pane of the window.
In the middle pane you will see PROJECT and TARGETS headers for your project. Click on your project name, then select Build Settings along the top to open the Build Settings editor for your entire project.
Find the Header Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build" directory you have added to your project. DO NOT check the Recursive checkbox.
Find the Library Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build/$(BUILD_STYLE)-$(PLATFORM_NAME)" directory you have added to your project.
NOTE: This is only necessary if you are NOT using DerivedData.
Find the Other Linker Flags entry and double click it. Use the + button to add a new entry and enter -ObjC -all_load. Dismiss the editor with the Done button.
Locate the target you wish to add RestKit to in the TARGETS list in the middle of the editor pane. Select it to open the target settings editor in the right pane of the window.
Click the Build Phases tab along the top of the window to open the Build Phases editor.
Click the disclosure triangles next to the Target Dependencies and Link Binary with Libraries items.
In the Target Dependencies section, click the + button to open the Target selection sheet. Click on the RestKit aggregate target (it will have the bulls-eye icon) and click the Add button to create a dependency.
In the Link Binary with Libraries section, click the + button to open the Library selection sheet. Here we need to instruct the target to link against all the required RestKit libraries and several system libraries. Select each of the following items (one at a time or while holding down the Command key to select all of them at once) and then click the Add button:
libRestKitCoreData.a - Optional. Only necessary if you are using Core Data.
libRestKitJSONParserJSONKit.a
libRestKitNetwork.a
libRestKitObjectMapping.a
libRestKitSupport.a
CFNetwork.framework
CoreData.framework - Optional. Only necessary if you are using Core Data
MobileCoreServices.framework
SystemConfiguration.framework
libxml2.dylib - Optional. Only necessary if you are mapping from XML payloads and link libRestKitXMLParserLibxml.a into your app.
Verify that all of the libraries are showing up in the Link Binary with Libraries section before continuing.
Congratulations, you are now done adding RestKit into your Xcode 4 based project!
You now only need to add includes for the RestKit libraries at the appropriate places in your application. The relevant includes are:
#import <RestKit/RestKit.h>
// And if you are using Core Data...
#import <RestKit/CoreData/CoreData.h>
I found this tutorial very useful to make it work on xCode 4.0.
http://liebke.github.com/restkit-github-client-example/
I did my build following this steeps https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x and guoleii is right. But I needed to change the owner directory.
Have you seen this threads from RestKit's Google Group?
link 1
link 2
Try searching there. But for now, there seems to be A LOT of issues with RestKit and Xcode 4, there's even a YouTube video showing the problems (none showing a how-to).
did you build RestKit according to the wiki page "Installing RestKit in Xcode 4.x" on github.com/RestKit? i think there is a little mistake. here is my solution: 1. in "Build Phases" -> "Link Binary With Libraries", delete the RestKit.framework and add Security.frameWork 2. build again
then it works.
I just tried to install RestKit on a newly created Xcode 5 iOS 7.0 project. I tried downloading the project and following the steps above, but i was missing most of the content with in the RestKit/Vendor folder. After doing a bit of research i did the submodule tactic and that got me all of the information from those folders.
From the command prompt change directory into your project folder, for me it was
$ cd Documents/Projects/NewlyCreatedApp
From there you should run this command if you have no git repository
Note: you must download git to install this, if you have not already
$ git init
after that you must run these commands to download restkit into your project folder
$ git submodule add git://github.com/RestKit/RestKit.git
$ git submodule update --init --recursive
After that, you should go up to Nakkeeran's answer above and start from step 2, to set up the process. In step 7 you will be asked to add "$(SOURCE_ROOT)/RestKit/Build" to your header search paths, but upon closer inspection the RestKit framework no longer has the build folder so you should change that to "$(SOURCE_ROOT)/RestKit/Code" to fit the current version of Rest Kit
I hope this helps, and here is a link to the submodule information i posted.
RestKit Installation Submodule Method

MVC2 publish failing due to image that was removed

I have recently tried to deploy my MVC2 application and have had great success in the past. Now, I have removed an image that was no longer needed and I'm no longer able to publish the application. I keep getting:
Error 54 Copying file Images\xxx.jpg
to
obj\Debug\Package\PackageTmp\Images\xxx.jpg
failed. Could not find file
'Images\xxx.jpg'.
How do I get rid of this error so I can publish my application again?
Ah hah! A question I can answer!
I would make sure that any references to the file(s) in question are removed from the project.
i.e.
If you see any files that have an exclamation mark next to it, exclude these from the project.
Installer? If so, that is where the reference to the image is. You can either rebuild the output of the package (delete and reset) or manually prune the reference.
Is there a reference to it in the project file?
Unload your project (right click on the project -> Unload Project)
Edit the project (right click on the project -> Edit Project)
Search for the image name in the project XML file.