Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # AppController.rb
- # test
- require 'osx/cocoa'
- OSX.ns_import :MyObject
- class AppController < OSX::NSObject
- include OSX
- def initialize
- @tester = MyObject.alloc.init;
- end
- # Objective-Cのメソッドを呼び出し
- def doTest(sender)
- puts "doTest:"
- @tester.methodA_from(false, self)
- end
- ib_action :doTest
- # Objective-C側から呼び出してもらうコールバックメソッド
- objc_method :callback, [:BOOL, :BOOL]
- def callback(para)
- puts "callback:"
- puts "para is #{para}"
- puts "callback return <false>"
- return false
- end
- end
Add Comment
Please, Sign In to add comment