• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Controller initialization issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Controller initialization issue
      • From: Scott Anguish <email@hidden>
  • Prev by Date: RE: Current active window is modal or not
  • Next by Date: Re: Controller initialization issue
  • Previous by thread: Re: NSToolbar Problem
  • Next by thread: Re: Controller initialization issue
  • Index(es):
    • Date
    • Thread