Search code examples
xcodecocoastackmob

Compiling Stackmob iOS SDK for Mac OS X


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


Solution

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