[MacRuby-devel] MacRuby with UIKit

Laurent Sansonetti lsansonetti at apple.com
Sun Mar 9 11:51:55 PDT 2008


On Mar 9, 2008, at 10:13 AM, Shane Vitarana wrote:

> On Sun, Mar 9, 2008 at 2:15 AM, Laurent Sansonetti
> <lsansonetti at 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


More information about the MacRuby-devel mailing list