Controller Layer and initialize method in model class
Controller Layer and initialize method in model class
- Subject: Controller Layer and initialize method in model class
- From: James Hillhouse <email@hidden>
- Date: Thu, 4 Dec 2003 18:53:31 -0600
Hey all,
I've been playing around with variations of Apple's example "Currency
Converter" code found in the Controller Layers documentation; I used
the online version (
http://developer.apple.com/documentation/cocoa/conceptual/
ControllerLayer/index.html ). But one thing I haven't redone on my own
is the code for the class method initialize found in the model class
Converter which goes as follows,
+(void)initialize
{
[ OrbitalRadius setKeys:
[ NSArray arrayWithObjects:@"orbitalPeriodInDays", @"mu", nil ]
triggerChangeNotificationsForDependentKey:@"orbitalRadiusCalculated" ];
}
One could just as easily make the following relationships where
orbitalPeriodInDays = exchangeRate, mu = amountInDollars, and
orbitalRadiusCalculated = amountInOtherCurrency and be pretty close the
"Currency Convert Enhanced" code.
So, what's my question? Well, I'm interested in what other ways there
might be to initialize so that, when the app starts up, values are
entered into the fields, then the needed calculations are executed.
One last question. Does anyone know of some sites where I can get some
inspiration as to other ways to use the Controller layer bindings? I
hate to reinvent the wheel, esp. when mine is starting off as square.
Thanks,
Jim
email@hidden
877-586-5372
_______________________________________________
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.