Has anyone tried MacRuby with UIKit yet? I started a new CocoaTouch application and changed the project settings to include the Ruby link flag and header and lib paths, closely matching a new MacRuby project. Here is how my main.m file looks like: #import <UIKit/UIKit.h> #import "ruby/ruby.h" int main(int argc, char *argv[]) { return macruby_main("rb_main.rb", argc, argv); } Unfortunately, I get a symbol(s) not found error for macruby_main. Is importing ruby.h enough? Is there anything else that has to be done? I know that macruby_main lives in objc.m, which should be getting included with the MacRuby distribution. The project is running in the Debug - Aspen simulator. Thanks, Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
In order for a MacRuby Cocoa app to function, it must be linked against the MacRuby version of libruby.dylib. I don't believe I've heard anything about CocoaTouch support at this time. On Mar 8, 2008, at 10:31 PM, Shane Vitarana wrote:
Has anyone tried MacRuby with UIKit yet?
I started a new CocoaTouch application and changed the project settings to include the Ruby link flag and header and lib paths, closely matching a new MacRuby project. Here is how my main.m file looks like:
#import <UIKit/UIKit.h> #import "ruby/ruby.h"
int main(int argc, char *argv[]) { return macruby_main("rb_main.rb", argc, argv); }
Unfortunately, I get a symbol(s) not found error for macruby_main. Is importing ruby.h enough? Is there anything else that has to be done? I know that macruby_main lives in objc.m, which should be getting included with the MacRuby distribution. The project is running in the Debug - Aspen simulator.
Thanks, Shane
-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Mar 8, 2008, at 10:31 PM, Shane Vitarana wrote:
Has anyone tried MacRuby with UIKit yet?
Not currently supported. I also suspect, though of course I can't say for sure, that a MacRuby application on the iPhone would be bumping its head rather severely on memory headroom. - Jordan
On Mar 8, 2008, at 11:28 PM, Jordan K. Hubbard wrote:
On Mar 8, 2008, at 10:31 PM, Shane Vitarana wrote:
Has anyone tried MacRuby with UIKit yet?
Not currently supported. I also suspect, though of course I can't say for sure, that a MacRuby application on the iPhone would be bumping its head rather severely on memory headroom.
Definitely, also, I doubt it would even run since the Objective-C GC is not supported on the phone. Laurent
On Sun, Mar 9, 2008 at 2:15 AM, Laurent Sansonetti <lsansonetti@apple.com> wrote:
Definitely, also, I doubt it would even run since the Objective-C GC is not supported on the phone.
I guess this is why the Objective-C sample code for the iPhone explicitly deallocates memory. Can't the same be done for MacRuby with the GC turned off? Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
On Mar 9, 2008, at 10:13 AM, Shane Vitarana wrote:
On Sun, Mar 9, 2008 at 2:15 AM, Laurent Sansonetti <lsansonetti@apple.com> wrote:
Definitely, also, I doubt it would even run since the Objective-C GC is not supported on the phone.
I guess this is why the Objective-C sample code for the iPhone explicitly deallocates memory. Can't the same be done for MacRuby with the GC turned off?
No, there is no way right now to disable the GC in MacRuby and go back to the previous memory scheme. Also, as you may know, Ruby was designed to be garbage collected, so forcing developers to explicitly retain/release objects isn't really an option. What could be done is to resurrect the original Ruby GC and make sure every Objective-C object is properly retained/released, inside the core. Which is in fact what RubyCocoa does, but this brings several different problems (as well as of course the problems of the original Ruby GC). If you want to investigate, I would suggest you to start with RubyCocoa instead, which theoretically should run, modulo perhaps a few modifications. But don't forget that memory on the phone is a critical variable. Laurent
On Sun, Mar 9, 2008 at 12:51 PM, Laurent Sansonetti <lsansonetti@apple.com> wrote:
No, there is no way right now to disable the GC in MacRuby and go back to the previous memory scheme. Also, as you may know, Ruby was designed to be garbage collected, so forcing developers to explicitly retain/release objects isn't really an option. What could be done is to resurrect the original Ruby GC and make sure every Objective-C object is properly retained/released, inside the core. Which is in fact what RubyCocoa does, but this brings several different problems (as well as of course the problems of the original Ruby GC).
If you want to investigate, I would suggest you to start with RubyCocoa instead, which theoretically should run, modulo perhaps a few modifications. But don't forget that memory on the phone is a critical variable.
Thanks for the suggestions Laurent. Patching the Ruby GC to manage Objective-C objects sounds messy, and I'd rather not deal with the problems with Ruby GC. Looks like I'll be sticking with Objective-C until there is a viable Ruby implementation for the iPhone. Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
On Sun, Mar 9, 2008 at 1:28 AM, Jordan K. Hubbard <jkh@apple.com> wrote:
Not currently supported. I also suspect, though of course I can't say for sure, that a MacRuby application on the iPhone would be bumping its head rather severely on memory headroom.
What needs to be contributed to MacRuby to make it even theoretically support iPhone dev, regardless of memory footprint? Shane -- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
participants (4)
-
Jordan K. Hubbard
-
Laurent Sansonetti
-
Shane Vitarana
-
Wayne Steele