Friday, October 13, 2006

Interface builder, Cocoa, and interactive development

I went ahead and scrapped the Factor code which defines Factor's menu bar on Mac OS X in favor of using Interface Builder to set the menu bar up. I discovered that Cocoa is fully capable of reloading nib files at runtime.

Factor can subclass Objective C classes. Until now however, the definition would only be entered if the class did not already exist, so if you changed some method definitions and reloaded the source file which contains them, the methods would not be visible to the Objective C runtime until you restarted Factor. I fixed this so that method definitions are replaced on the fly when a new Objective C class is defined in Factor, even if the class already exists in the runtime.

Together with the nib reloading, I can add a menu item together with the corresponding action, and observe the result instantly.

Factor is now a better Objective C (and XCode) than Objective C (and XCode).

No comments: