[Pyobjc-dev] NIB Validation & action methods
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-16 21:35:00
|
For action methods, I would suggest not building the stub methods for each action. Cocoa's nib loading mechanism already verifies that an action method exists as the NIB is loaded and, if not, will emit a message such as... 2002-11-16 16:29:47.283 example[1603] Could not connect the action randomAction: to target of class ExampleObject ... which serves nicely to remind the developer that that particular action method needs to be implemented. Note that pushing the button that tried to connect that action doesn't do anything. As far as outlets are concerned, validation becomes more difficult. Whether or not the outlet exists is determined by the configuration of the NIB file, not the developer and, as such, it is impossible-- given Just's most excellent code-- for the developer to 'use' an outlet that is not actually declared in the NIB (the developer can try, but they will get the classic KeyError style 'no such attribute' python exception). b.bum |