[MacRuby-devel] RoxorReturnFromBlockException*
Gabriel Gilder
gabriel at gabrielgilder.com
Wed Mar 30 10:23:47 PDT 2011
I think you want "break" instead of "return". You can't return from a block
(Proc).
-Gabriel
On Wed, Mar 30, 2011 at 7:53 AM, Martin Hawkins <martin.hawkins at gmail.com>wrote:
> From what I can read in the archives, this was raised about 18 months
> ago. Loosely following Matt's book, I've written the following code:
> def showOpenPanel( sender)
> openPanel = NSOpenPanel.openPanel
> openPanel.setCanChooseDirectories( false)
>
> openPanel.setShowsHiddenFiles(
> NSUserDefaults.standardUserDefaults.boolForKey( 'showHiddenFiles'))
> openPanel.setAllowsMultipleSelection( true)
> openPanel.beginSheetModalForWindow window, completionHandler:
> Proc.new{|result|
> return if (result == NSCancelButton)
> # throws error
> }
> end
>
> The result is (on OS X 10.7, MacRuby 0.10), when the cancel button is
> pressed,
> uncaught Objective-C/C++ exception...
> terminate called after throwing an instance of
> 'RoxorReturnFromBlockException*'
> Program received signal: “SIGABRT”.
> sharedlibrary apply-load-rules all
>
> Interestingly, on Lion, the output then appears to loop:
> unable to read unknown load command 0x24
> unable to read unknown load command 0x26
> unable to read unknown load command 0x24
> unable to read unknown load command 0x26
> .
> .
> Do you need a new ticket?
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110330/9cc291a9/attachment.html>
More information about the MacRuby-devel
mailing list