[MacRuby-devel] Overriding +autosavesInPlace

Sven A. Schmidt sas at abstracture.de
Sat Oct 8 08:25:31 PDT 2011


Hi all,

I'm trying to add autosave and versions to an application and as far as I can tell from the docs it should be as simple as overriding +(BOOL)autosavesInPlace to return YES from my core data document application. So what I have is essentially:

class MyDocument < NSPersistentDocument

  ...

  def autosavesInPlace
    return YES
  end

end

However, I don't get autosave or versions behavior (i.e. I've still got the "dirty dot", no versions menu in the title bar etc). Also, autosavesInPlace doesn't seem to get called. When I print a log message in there it never shows up in the console.

Should this be working the way I'm doing it? Unfortunately, I don't have a Cocoa application to compare (yet) so I'm not sure if I'm doing something wrong at the frameworks end or on the MacRuby side.

One thing I was wondering (since I'm rather new to both Ruby and MacRuby): I'm overriding a class method here (+(BOOL), not -(BOOL)), is there anything special I need to consider when doing this from MacRuby?

Cheers,
Sven

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3770 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111008/712eb2fc/attachment.bin>


More information about the MacRuby-devel mailing list