aws sdk for mac os x application development [closed] - objective-c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need to develop an application for MAC OS X, which will be uploading the chosen files to amazon web services. But for that I need aws sdk for mac. I haven't found any on the web. Is it possible to modify the AWS SDK for iOS so it can be used for Mac?
Also, the AWS SDK documentation doesn't explain how to upload files to S3. Does anyone have an example of how to do this?
Thanks

I've created a fork of the AWS iOS SDK which can be built and used for Mac OS X development. Check it out: https://github.com/amberdixon/aws-sdk-ios. In the readme, I've included instructions on how to build the Mac OS X version of the AWS iOS SDK framework. The tomandersen repo appears to use a much older version of the iOS SDK, the version I've created is a bit more current.

Judging by a discussion on this topic in the AWS Developer Forums, there doesn't seem to be an official AWS SDK for MacOS X yet, but the iOS version is close to useable. One contributor to that thread has posted a modified version that allegedly works on MacOS X for at least some of the services. I don't have any personal experience with it, but it seems worth a look.

Following on a previous answer, I forked and modified v2.2 of the AWS SDK for iOS so it now builds for Mac OS X (tested in Yosemite 10.10.3): https://github.com/johnabender/aws-sdk-ios Also checkout the tvos branch!
They provide a command-line tool to package the SDK components as .framework objects. Run Scripts/SdkPackage.sh AWSS3, and it will build the S3 framework and any dependencies. Run Scripts/Package.sh to build all the frameworks. The built frameworks wind up in the root/build of your AWS SDK directory if you build them all.
But yikes, their documentation is awful. For example, if you want to use an access key instead of a Cognito identity, you have to go through the code and figure out how (at least it's possible!). Want to list an S3 bucket's contents? Good luck. Most of the required classes aren't even listed in the documentation. And you'll have to include libz.dylib in your project to get it to build with the S3 SDK - they don't tell you that, either.
Anyway, here's some code to help anyone get started:
// This is helpful, also basically undocumented.
AWSLogger.defaultLogger().logLevel = .Verbose
let credentials = AWSStaticCredentialsProvider(accessKey: accessKeyId, secretKey: secretAccessKey)
let config = AWSServiceConfiguration(region: AWSRegionType.USWest2, credentialsProvider: credentials)
let listRequest = AWSS3ListObjectsRequest()
listRequest.bucket = "mybucket"
listRequest.prefix = "folder/"
// The key name allows you to set up multiple, global S3 configurations
// -- in case you'd ever want to do that, in violation of OO programming principles.
// But there's no way to make S3 requests using only a local config.
AWSS3.registerS3WithConfiguration(config, forKey: "s3")
AWSS3.S3ForKey("s3").listObjects(listRequest).continueWithBlock { (task: AWSTask!) -> AnyObject! in
if task.error != nil {
NSLog("error %#", task.error)
}
if task.result != nil {
NSLog("finished %#", task.result!.description)
}
return nil
}

As Caleb mentioned: There is no official AWS SDK for OS X.
The easiest way to accomplish S3 file upload is using ASIHTTPRequest. It's a wrapper for CFNetwork, which is easy to use. A drawback is no ARC support, so you have to handle memory management on your own …

I needed the AWS SDK for Mac to support prepopulating a db for my iOS app and was amazed that it didn't exist (considering how trivial it would be to produce as would be so similar to the iOS version). I downloaded the github MacOS SDKs mentioned by Amber above and the one mentioned in the AWS link above. However neither built straight off so I decided to modify the iOS SDK myself so I could understand what the process was.
Here are the steps that I went through to get DynamoDB working in XCode 5.0.2 on MacOS 10.9:
1.Download the iOS AWS 1.7.0 SDK, duplicate the folder and rename the folder to aws-MacOS-sdk-1.7.0 (a small amount of conditional compilation and if/else in the build script would do away with this step)
2.Modify src/Scripts/Framework.sh - this is the build tool for all the AWS frameworks
- Replace all four xcodebuild lines (30-39) with:
`xcodebuild -configuration Release -project "${PROJECT}.xcodeproj" -target "${PROJECT}" -sdk macosx10.9`
Replace the lipo line (82-87) with:
FRAMEWORK_INPUT_MAC_FILES="build/Release/lib${PROJECT}.a"
cp "$FRAMEWORK_INPUT_MAC_FILES" "$FRAMEWORK_DIR/Versions/Current/$FRAMEWORK_NAME"
3.In the src folder there is an XCode project per framework, for each one you need:
Change Project's Base SDK to latest OS X
Change FTarget's Framework's SDKROOT to macosx10.9
Ensure current scheme is set to Framework and build
Fix compiler errors (I had a bunch of problems to do with #property, had to replace <UIKit/UIKit.h> with <Cocoa/Cocoa.h> here and there, and [[UIDevice currentDevice] systemName] with [[NSProcessInfo processInfo] operatingSystemVersionString]
To get DynamoDB working I had to build four frameworks - it was fairly painless

Related

I have multiplatform apps in node-webkit. How do I convert them to nw.js?

I have a bunch of applications that run fine using node-webkit on Macs and Windows.
(They mostly live on shared Dropbox folders. They read and write to data files in the folder).
I gather node-webkit will not run on Mac Catalina.
So I am trying to figure out how to install and use nw.js
I need the Mac and Win versions of the app to be in the same directory. Multiple users will run their local Dropbox version of the app, and read/write to the shared data folders.
I cannot figure out how to get convert the app from node-webkit to nw.js
I've been unable to find an "idiot's guide" to this.
Any suggestions, or pointers to resources, would be most helpful.
Thanks in advance.
And apologies for posting what is probably a dumb question for most users of this site....
You have to run your app's old source code (node-webkit) with NW.js and fix all the exceptions thrown. You can find the migration guide here.

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.)

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.'

How to install protocol buffers with Objective C/iOS 5 SDK?

Does anyone know how to get protocol buffers working with the most recent version of the iOS SDK?
I tried the instructions given here: http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers
I have successfully installed 'protoc' and have also successfully compiled Objective-C output files using it, but the project that it tells you to list as a dependency is outdated and I get errors when I try to build my app.
Alternatively then, does anyone know to make the project compatible with the most recent version of the SDK?
You can find the related IOS 5 arc enabled port if metasyntactic protobuf
https://github.com/regwez/protobuf-objc-iOS5
Although I am having difficulties with the generated code (repeated type fields won't compile, at least for me), it might be a starting point for you.

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.