Re: KVO and bindings question
Re: KVO and bindings question
- Subject: Re: KVO and bindings question
- From: "Louis C. Sacha" <email@hidden>
- Date: Wed, 2 Jun 2004 07:05:41 -0700
Hello...
FYI, the recommended way to write your initialize method is:
+ (void)initialize
{
if (self == [YourClass class])
{
// do any needed initialization for the class
/* ... */
}
}
http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/FrameworkImpl.html#//apple_ref/doc/uid/20001286/1001755
Even though this only matters once your class has been subclassed, it
is still a good idea to get into the habit of doing this.
Louis
On Jun 1, 2004, at 3:38 PM, Don Rainwater wrote:
Well, in this particular case, my initialize method is only calling
NSValueTransformer's setValueTransformer:forName: method for each
of the value transformers I've written (I'm up to 3 now). Is there
any harm in registering the same value transformer more than once?
If so, it looks like I could use valueTransformerForName: to see if
the value transformer already exists (returns nil if not).
Probably good form anyway.
as I recall, this isn't an issue. So don't worry about it.
but you're better wrapping the entire initialize contents in
something that will prevent anything from being called, rather than
unregistering and registering the VT.
_______________________________________________
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.