@@ -278,16 +278,16 @@ + (void)initialize { } -+ alloc ++ (instancetype)alloc { return of_alloc_object(self, 0, 0, NULL); } -+ new ++ (instancetype)new { return [[self alloc] init]; } + (Class)class @@ -475,11 +475,11 @@ + (BOOL)resolveInstanceMethod: (SEL)selector { return NO; } -- init +- (instancetype)init { return self; } - (Class)class @@ -1155,11 +1155,11 @@ { @throw [OFNotImplementedException exceptionWithSelector: selector object: self]; } -- retain +- (instancetype)retain { #if defined(OF_HAVE_ATOMIC_OPS) of_atomic_int_inc(&PRE_IVARS->retainCount); #else OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock)); @@ -1196,16 +1196,16 @@ if (c == 0) [self dealloc]; #endif } -- autorelease +- (instancetype)autorelease { return _objc_rootAutorelease(self); } -- self +- (instancetype)self { return self; } - (bool)isProxy @@ -1248,21 +1248,21 @@ free((char *)self - PRE_IVARS_ALIGN); } /* Required to use properties with the Apple runtime */ -- copyWithZone: (void *)zone +- (id)copyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [(id)self copy]; } -- mutableCopyWithZone: (void *)zone +- (id)mutableCopyWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } @@ -1301,16 +1301,16 @@ + (void)freeMemory: (void *)pointer { OF_UNRECOGNIZED_SELECTOR } -+ retain ++ (id)retain { return self; } -+ autorelease ++ (id)autorelease { return self; } + (unsigned int)retainCount @@ -1325,26 +1325,26 @@ + (void)dealloc { OF_UNRECOGNIZED_SELECTOR } -+ copy ++ (id)copy { return self; } -+ mutableCopyWithZone: (void *)zone ++ (id)mutableCopyWithZone: (void *)zone { OF_UNRECOGNIZED_SELECTOR } /* Required to use ObjFW from Swift */ -+ allocWithZone: (void *)zone ++ (instancetype)allocWithZone: (void *)zone { if OF_UNLIKELY (zone != NULL) { [self doesNotRecognizeSelector: _cmd]; abort(); } return [self alloc]; } @end