Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Controller initialization issue



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
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.