开发者

How to get interface builder to recognise receiving action method in delegate

NEWBIE QUESTION ALERT!

I have a brand new macruby application in Xcode 4.1.

In my application delegate I add this method:

def receiveSomeEventFromXib(sender)
    puts "receiveSomeEventFromXib"
end

In interface builder, I right click on the delegate object icon and I do not see the above method (there is no Received Action category in the popup).

The delegate object also开发者_运维百科 defines (straight out of the new project box):

attr_accessor :window

but interface builder complains that the delegate object does not have an outlet named window.

I am able to set the delegate object as the window's delegate and if I include a windowWillClose method in the delegate object is does get called.

What is the simple thing that I am missing (naming convention?) that I need to do in order to have interface builder recognise my outlets and received actions?

cheers, --Ben

Edit

This has been asked before: Interface Builder not Seeing Outlets with MacRuby


It is a known bug brought by Xcode 4.1. It looks like it depends on Xcode more than on MacRuby, i.e. we have to wait for Apple solving it, not for the MacRuby guys.

Look here http://www.macruby.org/trac/ticket/1322 for more and for a workaround.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜