Controller initialization issue
Controller initialization issue
- Subject: Controller initialization issue
- From: James Hillhouse <email@hidden>
- Date: Wed, 7 Jan 2004 01:13:47 -0600
Hey folks,
I have a one model application using an NSObjectController that has
four keys,
position
integratedPosition
integratedVelocity
integratedAcceleration
where position is entered and
integratedPosition
integratedVelocity
integratedAcceleration
are calculated. All keys output to text fields with no formatting. In
my model class, nicely named Integrator, I have the following
initializer
@implementation Integrator
+(void)initialize
{
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedPosition"
];
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedVelocity"
];
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedAcceleration" ];
}
Here's my issue. When the application first starts, the following
values appear
position 1.00
integratedPosition 1
integratedVelocity 1
integratedAcceleration inf
I would love a way to force all the initial values that appear on the
UI at start-up to be 0.00 or something like that. I've played around
with the Bindings pane in IB to no avail. And I've tried a couple of
things involving
@implementation Integrator
+(void)initialize
{
[ self setValue:@"1.00" forKey:@"integratedAcceleration" ];
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedPosition"
];
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedVelocity"
];
[ Integrator setKeys:
[ NSArray arrayWithObjects:@"position", nil ]
triggerChangeNotificationsForDependentKey:@"integratedAcceleration" ];
}
But keep getting back the following error at runtime
Integrator[770] [<Integrator 0x5fd054> setValue:forUndefinedKey:]: this
class is not key value coding-compliant for the key
integratedAcceleration.
What am I doing wrong? I can't seem to find anything in the
documentation that deals with forcing a textview to have a specific
output until my dependent key position has been entered.
Thanks,
Jim Hillhouse
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.