I have created a very basic Objective-C class.
MyClass.h
@interface MyClass: NSObject
@end
MyClass.m
#import "MyClass.h"
@interface MyClass()
@end
@implementation MyClass: NSObject {
NSMutableArray* _myArray;
}
@end
Xcode is showing the following warning on the @implementation
line:
Class implementation may not have super class
The warning goes away if I remove the NSMutableArray* _myArray;
line.
What does this warning mean? What am I doing wrong?
Delete NSObject
in the implementation
part. The super class has to be specified only in the interface
.
@implementation MyClass {
NSMutableArray* _myArray;
}
@end
@implementation MyClass: NSObject
You're not supposed to inherit from NSObject in the implementation.
you already got it in the @interface MyClass: NSObject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With