2012-05-04 38 views
7

RubyMotion提供了這些指令vendoring第三方代碼:http://www.rubymotion.com/developer-center/guides/project-management/#_files_dependencies使用解析的iOS SDK與RubyMotion

我想補充Parse.com的iOS SDK。這些是將其添加到XCode項目的說明:https://parse.com/apps/quickstart#ios/existing。但是,自從使用RubyMotion以來,我沒有使用XCode。

我記錄我嘗試在這裏:https://github.com/adelevie/RubyMotionSamples/commit/603bf4428995bb203cce7e7e8e6989d6e86bda3b

這裏是我得到的錯誤:https://gist.github.com/2595284

回答

8

我相信我們實際上在這裏處理一個靜態庫,所以我相信你應該指定:static而不是:Xcode作爲第二個選項。

在你的Rakefile下面的代碼,應用程序編譯:

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

但是,我越來越運行解析setApplicationId方法如下錯誤:

(main)>> Objective-C stub for message `setApplicationId:clientKey:' type `[email protected]:@@' not precompiled. Make sure you properly link with the framework or library that defines this message. 
+0

奇妙!它很棒! – user94154

+0

https://gist.github.com/2596866 – user94154

+1

你是如何解決'Objective-C stub'錯誤信息的? – richard

2

鏈接的文檔中說,「到供應商在RubyMotion項目第三方庫,源代碼必須在文件系統的某處可用。「所以我不認爲在那裏放置一個.framework文件是可行的。

您可以嘗試從parse.com/docs下載ParseStartProject,名爲「Blank Xcode w/SDK」。如果您供應該項目文件夾,RubyMotion將能夠找到它正在尋找的xcode項目。您當然希望從xcode項目中刪除.m和.h文件,因爲您只希望該項目包含Parse.framework。

我還沒有嘗試過。請讓我們知道,如果你得到它的工作。

+0

有這個麻煩:https://skitch.com/e-adelevie/8a9mg/users-adelevie-programming-motion-rubymotionsamples-tweets- bash-114x24 錯誤是'建築物供應商項目'供應商/ ParseStarterProject'未能創建至少一個'.a'庫。' – user94154

+0

更好的圖像鏈接https://img.skitch.com/20120504-mejht3xj22knxknu5naxgm9skc.jpg – user94154

1

好從這個複製在RubyMotion組中回答。它似乎修復了存根錯誤消息:

現在,要完成此項工作,我已修改/Library/RubyMotion/lib/motion/project/vendor.rb並將第38行上的Dir.glob從:

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

到:

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

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