Re: Compiler Error on Class Method?
Re: Compiler Error on Class Method?
- Subject: Re: Compiler Error on Class Method?
- From: Quincey Morris <email@hidden>
- Date: Wed, 21 Aug 2013 14:09:43 -0700
On Aug 21, 2013, at 09:58 , Dave <email@hidden> wrote:
> Implicit conversion of Objective-C pointer type 'Class' to C pointer type 'struct objc_class *' requires a bridged cast
>
> on the line marked below:
>
>
> + (NSString*) cacheDirectoryPath
> {
> NSString* myReturnValue; //**************** Error
>
> [self.pDeveloperUtilities logEntryWithMethodName:@"+ cacheDirectoryPath",nil];
>
> myReturnValue = [[super class] cacheDirectoryPath];
The problem must be in the last line quoted above. This is the only place in your code fragment where there is an expression of type 'Class'.
I think what you're actually trying to do is invoke the superclass's implementation, which you would do like this:
myReturnValue = [super cacheDirectoryPath];
What happens when you try that? Also, are you sure that the parent class's 'cacheDirectoryPath' is actually declared -- in a way that's visible at this point in the compilation -- and is a class method, not an instance method?
Incidentally, even if '[[super class] cacheDirectoryPath]' compiles without errors, it going to execute as if you had written '[[self class] cacheDirectoryPath]', which of course is at best an infinite regress. '[super class]' is *not* the class of the superclass of your class, as you seem to think.
_______________________________________________
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