Re: Objective-C Question
Re: Objective-C Question
- Subject: Re: Objective-C Question
- From: Jens Alfke <email@hidden>
- Date: Mon, 11 Mar 2013 13:49:32 -0700
On Mar 11, 2013, at 1:26 PM, Dave <email@hidden> wrote:
> I had assumed (and I thought I'd done something like this before) that the:
> myDict = [[super class] newDict];
> statement would call newDict in BaseClass???? Instead it calls the version in NewClass and goes into an infinite loop!!
No, what you want is “[super newDict]”.
Your method calls [super class] — i.e. the superclass’s implementation of +class, which is the same as your own since you didn’t override it — which returns your class’s Class object. Calling +newDict on that is the same method you’re calling from.
—Jens
_______________________________________________
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