From: Dave H. <gr...@gr...> - 2005-06-04 19:38:05
|
Am I the only person on this list who has NOT been programming in Objective-C before trying to use RubyCocoa? Certainly every scrap of documentation I've found takes for granted I know Obj-C or Java or both. I just spent a few hour running down an exasperatingly weird bug. I have my happy Interface Builder window and nib file, with all its outlets working (finally), and I start adding in actions. When I'm done, all my outlets have failed. Nothing I do can get any of my outlets to be anything but "NilClass::Nil." On the other hand, all my actions are going off as soon as the window opens, which is tending to overwrite the underlying information with blanks before I can fill in the window with the proper values. OK, fine, I can adapt. I change my actions to check for an "initialized" flag, and if it's not initialized, instead of copying the text or button or whatever TO the data, they load the interface element FROM the data. I still cannot reference interface elements unless they're poked by the user, but I guess I'll survive. I clean up my subclass by removing all those dysfunctional outlets. All my actions stop firing when the window opens. Initialization is now broken. If you like puzzles. stop here and see if you can figure out what "mistake" I made. My outlets were named things like "taskDue," "taskTitle," and "taskDescription," and when I added the actions, I named them "setTaskDue," "setTaskTitle," and "setTaskDescription." Xcode or IB or Cocoa or I-don't-know-who's-fault-this-is obviously decided they were related in some way and broke everything for me. I have gone back and put my outlets back in with names that can't be matched up, and now things work properly. I have no idea where I'd even find this "feature" documented. Sigh. Caveat Programmeri. |