1

I downloaded the StackMob iOS SDK. I can compile StackMob-v.1.4.0 from source to use in an iOS project (which was cool), but I'd really like to see if I can get it running on OS X. Looking through the github issue tracker, it looks like some fixes were put in to allow it to build for OS X.

The source consists of a workspace with the iOS-sdk and a cocoapods proj.

I tried changing:

Targets > StackMob-iOS-SDK > Base SDK to 10.8
Targets > StackMob-iOS-SDK > Architecture to Standard (64)

I removed occurrences of UIKit with AppKit, MobileCoreServices with CoreServices.

https://github.com/stackmob/stackmob-ios-sdk

I'm super lost at the moment, if anyone could point me in the right direction in getting the project to compile to OSX, that would be great.

Thanks! Matt

  • @combinatorial I made the changes you noted in the 'podspec' file, as well as replacing `platform :iOS` to `platform :osx` in my `podfile`. After running pod install, my workspace has `Pods` as `OS X SDK 10.8`, however my `stackmob-ios-sdk` is still `ios-sdk-6.1`. I tried just manually changing the framework in the project file to `10.8` with no luck. Any suggestions? – bastidiasRN Apr 07 '13 at 12:19
  • What do you mean when you say that you stackmob sdk is different from pods? You should just be using pods with no separate stackmob sdk. – combinatorial Apr 07 '13 at 17:44
  • When I open my workspace that cocoapods generated, theres a pods project and a iOS-sdk-project. The pods project is 10.8, the iOS project is 6.1. – bastidiasRN Apr 09 '13 at 11:55
  • I'm missing something...aren't I.... – bastidiasRN Apr 09 '13 at 12:14
  • Pods creates a workspace that contains a Pods project and also adds an existing project file in the same directory. Delete the existing project file and create a new project... as a Cocoa App for Mac OSX. I'd also delete the workspace. Then re-run pods, it should create a new workspace with the Pods project and your new project. – combinatorial Apr 09 '13 at 16:23

1 Answers1

4

Update

As of Stackmob iOS SDK 2.0 the cocoapods changes below are integrated into the main pods file, so you no longer need to make these changes to compile for MacOSX.

Original Answer

If you are using cocoapods then there is a way you can hack this to work. Edit:

~/.cocoapods/master/StackMob/1.4.0/StackMob.podspec

And replace:

s.platform = :ios, '5.0'

with:

s.ios.deployment_target = '5.0'
s.ios.frameworks = 'MobileCoreServices'
s.osx.deployment_target = '10.7'
s.osx.frameworks = 'CoreServices'

And replace:

s.frameworks = 'CoreData', 'CoreLocation', 'Security', 'SystemConfiguration', 'MobileCoreServices'

with:

s.frameworks = 'CoreData', 'CoreLocation', 'Security', 'SystemConfiguration'

Now if you do a pod install with the following in your Podfile you should get a working SDK.

platform :osx, '10.7'

Note that I have only used the SMDataStore API myself which seems to work fine. I haven't tried CoreData for example.

combinatorial
  • 9,132
  • 4
  • 40
  • 58
  • Thanks so much! I really appreciating you taking the time to help me out. I just have to get back to my computer to try this out. I'm pretty sure it will work based on the source =-). I'll let you know how the core data api works. – bastidiasRN Apr 03 '13 at 20:51
  • Still having trouble, see above comment. – bastidiasRN Apr 07 '13 at 13:30
  • It will take too long to explain what I was doing wrong... but it now looks like it works, thanks! – bastidiasRN Apr 09 '13 at 19:30