Where to put .m files (if possible)

83 views
Skip to first unread message

Kenny Lövrin

unread,
Jun 12, 2012, 4:16:59 PM6/12/12
to rubym...@googlegroups.com
Hey

I've asked this question before but didn't really get an answer and I can't find it in the docs, so I'm trying again, and if no one knows maybe Laurent knows at least. :)

The thing is that I want to use a C lib, and as I understand it I can't just use it as it is, but rather have to wrap it in Obj-C classes which is fine I guess. BUT, seeing that we're talking a RubyMotion project, I would like to be able to just write my Obj-C code in Textmate and have it compile together with the ruby code, but I can't figure out if it is possible.

It seems to me that vendoring libraries requires either an Xcode project/workspace or just a static lib with an .h file, rather than actual implementation files. I might be misunderstanding something, but does this then mean that if I want to use a C library, I have to first write the wrapper in Xcode, then build it in RubyMotion as a vendored Xcode project or even build a static lib and vendor that?

I guess once the Xcode project is setup I could write the code in Textmate, but I would have to open Xcode every time I wanted to add a file etc.

It would be nice to be able to write the Obj-C straight into the project for the times where it is really needed and specific to the project in question. So I guess the real question is, what is the expected workflow when I need to use a C library that doesn't have Cocoa wrappers?

Thanks!

-- 
Kenny Lövrin

Sebastiaan Pouyet

unread,
Jul 16, 2012, 5:18:02 PM7/16/12
to rubym...@googlegroups.com
Hi Kenny,

I came across your question as I was wondering the same. 
You asked this a while back, so probably figured it out for yourself but just in case (and for co-googlers), here's the answer by Laurent in another rubymotion thread:

You can simply move the .{m.h} files into a directory (ex. vendor/code) and use app.vendor_project 'vendor/code', :static

Cheers,
Sebastiaan
Reply all
Reply to author
Forward
0 new messages