I have written Objective-C before (a year or so ago), but it was before ARC. I have a class that has no need to inherit from NSObject (or any other NS* class), but if it doesn't, I get this error when attempting to instantiate a singleton:
+(Operator *) getInstance
{
static Operator * g_instance = NULL;
if (NULL == g_instance)
{
@synchronized( self )
{
g_instance = [[Operator alloc] init];
}
}
return( g_instance );
}
no known class for selector 'alloc' which is listed as an ARC issue.
Does ARC now require that all classes inherit from NSObject ? Or am I missing a bigger idea?