IB key-value oddity...
IB key-value oddity...
- Subject: IB key-value oddity...
- From: Fritz Anderson <email@hidden>
- Date: Wed, 13 Jun 2001 01:20:41 -0500
So I'm experimenting with a Cocoafied version of the Jeff Molofee
OpenGL tutorial <URL:
http://hene.gameworks.com/>, making the pyramid
spin, and I think to myself it would be a good thing to have a slider
to set the spin rate. I make a 1-to-10 NSSlider, and next to it I
put an NSTextField to display the current float value of the slider.
I have a controller object, which we'll just call Controller.
The controller's outlets and actions are as follows
Controller {
pyramidRate --> NSTextField
pyramidSlider --> NSSlider
-[setPyramidRate:] <-- NSSlider
}
I discover I have a namespace collision: When the nib loads,
setPyramidRate: gets called with an NSTextField * in the sender
parameter. After awakening from the nib, the pyramidRate outlet is
nil.
Renaming the action to newPyramidRate: fixes the problem.
I'm guessing I walked into a trap with the NSKeyValueCoding protocol,
but darned if I remember being warned of it. Could someone put me
out of my misery and point out where this is documented? Obviously
this is in a document I want to re-read.
This is IB 2.0.1 and PB 1.0.1.
-- F