NSObject+YYAddForARC.m 846 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // NSObject+YYAddForARC.m
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 13/12/15.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import "NSObject+YYAddForARC.h"
  12. @interface NSObject_YYAddForARC : NSObject @end
  13. @implementation NSObject_YYAddForARC @end
  14. #if __has_feature(objc_arc)
  15. #error This file must be compiled without ARC. Specify the -fno-objc-arc flag to this file.
  16. #endif
  17. @implementation NSObject (YYAddForARC)
  18. - (instancetype)arcDebugRetain {
  19. return [self retain];
  20. }
  21. - (oneway void)arcDebugRelease {
  22. [self release];
  23. }
  24. - (instancetype)arcDebugAutorelease {
  25. return [self autorelease];
  26. }
  27. - (NSUInteger)arcDebugRetainCount {
  28. return [self retainCount];
  29. }
  30. @end