Re: [Pyobjc-dev] NIB Validation & action methods
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-16 22:22:12
|
On Saturday, November 16, 2002, at 05:06 PM, Just van Rossum wrote: > bb...@ma... wrote: >> 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. > > Erm, when is this warning emitted? When the class is instantiated or > when the > button is clicked? If the latter: NibLoader could do it at > class-build-time. Neither; when the NIB is loaded and the nib loading mechanism walks through the connections to ensure that the appropriate target/action methods can be connected. This is the only time that such validation can occur. Class instantiation is too early as there may be additional methods added to the class between the time the class is created and those methods may contain the action implementations. b.bum |