On 11/18/09 9:00 AM, Corbin Dunn said:

>Oh -- another thing. Does your subclass of NSCollectionView override:
>
> (void)viewWillMoveToWindow:(NSWindow *)window {
>
>but not call super? If not... call super! Your classes should always
>call super if it is defined in a superclass, unless you have a good
>reason to hide the super's behavior.

Corbin,

This comment caught by eye.  As a general principle, I certainly agree
with your comment.

But I never call super when I override those methods, and I guess I
should be doing so.  Does NSView's implementation do something or only
NSCollectionView?

The docs often comment about calling super.  In NSView's case, they do
for beginDocument, beginPageInRect:atPlacement:, drawRect:, endDocument,
viewWillStartLiveResize, etc. but they don't for the
viewWillMoveToWindow:.  I guess I'm so used to seeing a comment, that if
I don't see one, I don't call super.  At least one Apple example also doesn't:
<http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/
EventOverview/MouseTrackingEvents/MouseTrackingEvents.html>

Should one call super for all the viewWill/Did methods?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 [email protected]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to