I’m not sure what the issue is- I’m getting “cannot find interface declaration for Singleton”,
here: @implementation Singleton
and I’m getting “Singleton may not respond to +alloc”,
here: static Singleton *shared;
The .m file
#import "Singleton.h"
@implementation Singleton
+(Singleton *) sharedSingleton
{
static Singleton *shared;
if (!shared) {
shared = [[self alloc] init];
}
return shared;
}
@end
The .h file
#import <Foundation/Foundation.h>
@interface Singleton : NSObject {
}
+ (Singleton *)sharedSingleton;
@end
I just want a basic Singleton class 🙁 They appear as warnings but I want them gone if possible! Hopefully it’s not stupid, it’s been a long day
Try cleaning your project if still it doesn’t remove warning then
Change your line from
to