Google Api 64bit Objective-C - objective-c

I want to implement in my Mac application the google API for uploading file on Gdocs, sadly I discovered that Google api for Objective-C are still in 32bit while my app is in 64bit with the new ARC support.
So before converting my app to 32bit I tried to build the google api in 64bit, I downloaded the .diff patch found here:
http://code.google.com/p/gdata-objectivec-client/issues/detail?id=30
and applied it.
Then I tried to rebuild the Google api in 64bit and it succeded (before there were errors), so I copied the Gdata framework in my project and I was able to build it without errors.
BUT, when I click play this is the error I retrieve:
dyld: Library not loaded: #loader_path/../Frameworks/GData.framework/Versions/A/GData
Referenced from: /Users/Xeo/Library/Developer/Xcode/DerivedData/GdocSync-fpcfhxbalzflkxdigudsndijtiol/Build/Products/Debug/GdocSync.app/Contents/MacOS/GdocSync
Reason: image not found
The framework is linked, I set it in the frameworks to link, soI don't really know how to do this, I would like to waste another bit of time before converting the app to 32bit!
EDIT: i was able to build it under xcode 4 with arc support only adding the sources into my app and building directly from there as explained in the google wiki.
No luck with the framework!

Try deleting the derived data from your app in the Xcode 4 organizer, give the target a good scrubbing and build again.

Related

Compiling/Running Cocoa Project implementing NSSharingServicePicker in 10.7.x

I am learning about Objective-C/Cocoa and have downloaded the source code to a popular TeX typesetter and loaded up the project in XCode to play around with it. Compiling fails, and all of the error messages I have seen (so far) have to do with something called NSSharingServicePicker not being recognized. I gather (from this SO question and this Apple documentation page) that this is a class not available in 10.7.x. It therefore makes sense why the code won't compile on my Lion machine.
My question is, I guess, why I am able to run the downloaded package of TeXShop on 10.7 at all? (According to the website, this version is for OSX 10.7 and up.) I am interested in making a few minor changes to this project; am I not able to check my changes/compile unless I'm using a Mountain Lion machine? Is there some kind of update I can download for coding/compiling purposes?
Assuming you are using Xcode 4.6.*, you should be able to set your project to use the 10.8 SDK and get past the compile errors. (That's the "Base SDK" build setting.)

What will happen if a framework get deleted from an app?

I was asked a question, what will happen when a framework is accidentally deleted from your device may be iphone or mac?
Whether your application crash or it will work without any error?
Please provide me answer with explainations.
You may get linking error. If framework folder is inside the application means its runtime linking.
OS X embeds an "install name" inside each dynamic library. This
install name is the path to where the library can be found when dyld
needs to load it. When you build an application that links against a
dynamic library, this install name is copied into the application
binary. When the application runs, the copied install name is then
used to locate the library or framework.
$ otool -D /Applications/Google\ Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python
/Applications/Google Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python:
#executable_path/../Frameworks/Python.framework/Versions/2.6/Python
so if you will delete Frameworks folder you will get Dyld Error.
Dyld Error Message:
Library not loaded: #loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle
Referenced from: /Applications/Transmission.app/Contents/MacOS/Transmission
Reason: image not found
If a framework is deleted, only software linking to that framework would be affected.
If it is a system framework, expect your system to start failing.
If it is a 3rd party framework, it should be limited in scope of impact.
If it is in your app bundle, and your app is code-signed, the removal of the bundled framework should prevent your app from launching.
It depends on if the application needs access to the framework you have removed.
If you application requires the framework then it will not compile.
If you dont need it, it will just compile like normal.

How to unlink a framework on program start

I am developing for iPhone OS 3.1.3 and I need to use Dropbox API.
The problem is the Dropbox API requires at least iOS 4.2. Ok.
I decided to save the possibility of using the program under 3.1.3, but if it is 4.2 and higher, there will be Dropbox functionality.
To use Dropbox framework I needed to link another frameworks:
Security.framework
QuartzCore.framework
I have done this.
When I link Dropbox.framework to my project, the program works great on iPhone Simulator, but it cannot be started on my iPhone 3.1.3. There is an error in Output:
dyld: Symbol not found: _kSecAttrAccessible
Referenced from: /var/mobile/Applications/C1FC10E5-0A36-4DEB-BD27-5028C205C89D/Bus Time.app/Bus Time
Expected in: /System/Library/Frameworks/Security.framework/Security
in /var/mobile/Applications/C1FC10E5-0A36-4DEB-BD27-5028C205C89D/Bus Time.app/Bus Time
So the question is:
Can I detect the iOS version on the program start and unlink the framework?
Or could you offer an another way to use dropbox for 3.1.3?
Thank you for your answers. I appreciate it.
You cannot programmatically unlink a framework at runtime.
You can programmatically link a framework at runtime, e.g. by using the NSBundle APIs, or dlopen, or various other ways. If you do so, you have to then manually load the ObjC objects and/or C symbols you want.
Alternatively, you can weak-link the framework, which makes the runtime do most of the work for you. If it's there, it will be loaded in at startup, and all of its ObjC objects and C symbols will be available to you. Otherwise, all of its ObjC objects and C symbols will be null. So, all you have to do is check for null to decide whether to run the code that needs that framework.
Select the Security framework in your file list.
Expand the right sidebar (View > Utilities > Show Utilities).
Under 'Target Membership' change 'Required' to 'Optional.'

Where can I download the Core Audio SDK for Xcode? (Not apple developer site it seems)

As per the instructions here:
http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/CoreAudioOverview/WhatisCoreAudio/WhatisCoreAudio.html#//apple_ref/doc/uid/TP40003577-CH3-SW1
It says:
The Core Audio SDK assumes you will use Xcode as your development environment.
You can download the latest SDK from http://developer.apple.com/sdk/. After installation, the SDK files are located in /Developer/Examples/CoreAudio.
I looked at all the SDKs and did a search for Core audio. Nothing shows up. Does anyone know where I can find the Core Audio SDKs?
The Core Audio framework is just a standard framework in /System/Library/Frameworks, so you already have the headers and libraries. The additional SDK stuff is now installed as part of the Xcode 4 installation - you'll find it at /Developer/Extras/CoreAudio after installing Xcode 4.
The document you referred to is kinda old (written in 2007) and you've discovered that Apple isn't always super good at updating their documentation.
The Core Audio SDK has been folded into the SDK's for MacOS and iOS.
At least one of sample programs referenced on the instruction page, PlaySequence, can be downloaded as sample code from Apple's developer website. I'm not sure what happened to PlayFile.
It seems the CoreAudio SDK was renamed Core Audio Utility Classes, and can be found there:
http://developer.apple.com/library/mac/#samplecode/CoreAudioUtilityClasses/Introduction/Intro.html
The documentation is out of date. Core Audio SDK is included with current Xcode 4.2. You need to link to it like this:
and of course include its header file.

json-framework doesn't work with iPhone SDK 3.0

I can't seem to get my app to compile when using JSON-framework http://code.google.com/p/json-framework/ with iPhone SDK 3.0.
My app compiles fine for the simulator, but when I go to compile for my device I get a 'codesign error' code 1. I've followed all of the installation instructions correctly, and when I remove the 'Additional SDK' reference and 'Other Linker Flags: -Obj-C -ljson' it compiles just fine...but obviously I then can't use JSON in my app.
Any ideas?
You may want to just switch to the code version and not link in the static lib.
It should compile and work fine on 3.0.
On my own project, I too ran into this problem. I was not able to build my app for iPhone OS 2.x using the iPhone 3.0 SDK.
The fix was to set the following at the project level (Get Info):
BaseSDK to iPhone Device 3.0
iPhone Deployment Target to iPhone OS 2.x
Code Signing Resource Rules Path to the same 2.x plist (e.g. /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/ResourceRules.plist)
The last bit allows a distribution (app store) build to code sign correctly... Otherwise you'll encounter an error "object file format invalid or unsuitable" since the code signer by default will use the same resource rules as the BaseSDK (i.e. 3.0), which is unsuitable for a 2.x app.
Also, be sure to clear any of the above settings at the target level (again, via Get Info).
Phew.
Codesign error means you do not have a valid provisioning profile for the device you are trying to compile to, using the current built settings.
Can you build and deploy sample apps to your phone?
I started using the lovely json-framework for the iPhone but then suddenly found that if I compiled for anything greater than 2.1 for a device, that it would pop up with:
Codesign error: “object file format invalid or unsuitable”
It took me a long time to figure out what was going on, but thanks to a blog post, the fix is this:
On the project settings, on the build tab, search for “Code Signing Resource Rules Path” and set “$(SDKROOT)/ResourceRules.plist” as its value.
I’m not sure how it works as it looks like that is the path it already has, but hey, it seems to work!
that solves the codesign error i was getting, but now I cant compile on 3.0 for some other reason. i'm going to try to link to the code rather than the library.
Sounds like an issue you would want to discuss with the developers, see the support group.
It seems like the code signing isn't extending to the framework. Have you tried linking the framework differently?
And for French persons, here is a tutorial too here too (en Français)
But for your problem I think it's not about JSON but more with your key developer.