Class defined without specifying a base class?
Solution 1
You will need to import the file that defines AGWindowView at the top of the file. The compiler will need to know about the whole class, not just that it exists.
Solution 2
Be sure to import the .h
file in your .m
file!
// XYZYourClass.m
#import "XYZYourClass.h"
@implementation YYZYourClass
@end
If you don't #import XYZYourClass.h
, you'll get the error:
Class 'XYZYourClass' defined without specifying a base class
Solution 3
We had this problem trying to install an old-ish cocoapod. The problem was that a macro wasn't taken into account at the time of the analysis.
The default option in the pods project file for the "Unintentional Root Class" LLVM Warning is now defaulted as "Yes (treat as error)" instead of "Yes" like it used to be.
Related videos on Youtube
soleil
Updated on June 05, 2022Comments
-
soleil about 2 years
Simple inheritance that I've done a million times:
@class AGWindowView; @interface HelperView : AGWindowView
I get this error:
Class "HelperView" defined without specifying a base class.
Well, obviously I am specifying a base class. What is going on here? Is there some way AGWindowView would not allow itself to be subclassed?