From: Dave H. <gr...@gr...> - 2005-06-04 23:12:44
|
So where's a good place to put things I've learned that others might want to know? I managed to break my window loaders three times while trying to get things organized before finally figuring out what was going on. The code for the RubyCocoa sample "RubyRaiseMan" for example, has require 'PreferenceController' in MyDocument.rb. I *thought* when looking at rb_main.rb, that it would load ALL *.rb files, but if I also didn't include all my own .rb files at the beginning of my main file, classes would go missing, and windows would not open. Lo. Inline code is run at loading, and the loading order is undefined. (It looks like it's alphabetical.) I think I can finally predict the order of code outside a class, inside a class, inside the "init" method, inside the "initialize" method, ditto for all the above in files other than the main file, and how to use applicationDidFinishLaunching to delay some code further. Back to work... |