When to call super
When to call super
- Subject: When to call super
- From: "McLaughlin, Michael P." <email@hidden>
- Date: Tue, 12 Aug 2014 13:02:54 +0000
- Thread-topic: When to call super
Is there a sure-fire way to know when it is necessary to call super in an override?
Sample code shows that calling super is necessary for methods such as
-(id)init
- (void)windowControllerDidLoadNib
but not for
(NSData *)dataOfType
(BOOL)readFromData
How can you know for sure?
This question occurred to me recently when I realized that my implementation of
(NSApplicationTerminateReply)applicationShouldTerminate
did not call super and I was wondering whether I should. Currently, I just clean up and return NSTerminateNow.
Thanks for any reply.
—
Michael P. McLaughlin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden