Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the Parse iOS SDK with RubyMotion

RubyMotion provides these instructions for vendoring 3rd party code: http://www.rubymotion.com/developer-center/guides/project-management/#_files_dependencies

I'm trying to add Parse.com's iOS SDK. These are the instructions for adding it to an XCode project: https://parse.com/apps/quickstart#ios/existing. However, I'm not using XCode since I'm working with RubyMotion.

I documented my attempt here: https://github.com/adelevie/RubyMotionSamples/commit/603bf4428995bb203cce7e7e8e6989d6e86bda3b

And here are the errors I'm getting: https://gist.github.com/2595284

like image 408
user94154 Avatar asked May 04 '12 15:05

user94154


3 Answers

I believe we're actually dealing with a static library here, so I believe you should specify :static instead of :Xcode as the second option.

With the following code in your Rakefile, the app compiles:

    app.libs << '/usr/lib/libz.1.1.3.dylib'
    app.frameworks += [
        'AudioToolbox',
        'CFNetwork',
        'SystemConfiguration',
        'MobileCoreServices',
        'Security',
        'QuartzCore']

    app.vendor_project('vendor/Parse.framework', :static,
        :products => ['Parse'],
        :headers_dir => 'Heiders')

However, I'm getting the following error running the Parse setApplicationId method:

(main)>> Objective-C stub for message `setApplicationId:clientKey:' type `v@:@@' not precompiled. Make sure you properly link with the framework or library that defines this message.
like image 188
richard Avatar answered Nov 10 '22 21:11

richard


The documentation linked says, "To vendor a 3rd-party library in a RubyMotion project, the source code must be available somewhere on the filesystem." So I don't think dropping a .framework file in there will work.

You could try downloading the ParseStartProject, called "Blank Xcode w/ SDK" from parse.com/docs. If you vendor that project folder, RubyMotion will be able to find an xcode project like it's looking for. You'll want to delete the .m and .h files from the xcode project, of course, since you only want the project to include Parse.framework.

I haven't actually tried this. Please let us know if you get it working.

like image 32
bklimt Avatar answered Nov 10 '22 23:11

bklimt


Okay copied this from an answer in the RubyMotion group. It seems to fix the stub error message:

Now, to make this work, I've modified /Library/RubyMotion/lib/motion/project/vendor.rb and changed the Dir.glob on line 38 from:

source_files = (opts.delete(:source_files) or Dir.glob('*. 
{c,m,cpp,cxx,mm,h}')) 

to:

source_files = (opts.delete(:source_files) or Dir.glob('**/*. 
{c,m,cpp,cxx,mm,h}'))

http://groups.google.com/group/rubymotion/msg/0efa74214523d0f5

like image 20
Sander Hahn Avatar answered Nov 10 '22 23:11

Sander Hahn