How do I make Interface Builder recognize IBOutlet/IBAction for new languages?
it's a theoretical question: suppose I come up with an outstanding new scripting language and want to make a Cocoa bridge for that.
Is it possible to make Interface Builder recognize the new language and parse the source code automatically so that it can list the IBAction
s and IBOutlet
s, just as it already does for Objective-C's .h
, RubyCocoa's .rb
, and PyObjC's .py
, and AppleScriptObjC's .applescript
files? Or is 开发者_Go百科it hard-coded into Interface Builder?
If it's possible, how can I do it and/or is there a document?
AFAIK this is not documented.
Matt Gallagher did a post a while back on the interprocess communication between Xcode and IB Interprocess Communication
Using those techniques, you may be able to pull something off.
Another thought is to capitalize on what IB already does and generate a .h file with the appropriate IB markers for your language of choice - e.g. write out a .h file with the elements you want exposed.
精彩评论