The runtime system sends an initialize message to every class
object
before the class receives any other messages and after its
superclass
has received the initialize message. [...]
Because of inheritance, an initialize message sent to a class that
doesn’t implement the initialize method is forwarded to the
superclass,
even though the superclass has already received the initialize
message.
For example, assume class A implements the initialize method,
and class
[...]
To avoid performing initialization logic more than once [...]
But more importantly:
Note: Remember that the runtime system sends initialize to each
class
individually. Therefore, in a class’s implementation of the
initialize
method, you must not send the initialize message to its superclass.
This means if I have:
class Person
name (key)
uppercaseName (dependent key)
class Employee
department
and I do as the example suggests, that dependent keys won't be
registered for Employee if it implements +initialize, and per the
runtime docs, doesn't call send initialize to the super class.
What is the recommended/clean solution to this problem?
Thanks,
Jim _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden