20
20
#import " NSInvocation+OCMAdditions.h"
21
21
#import " OCMFunctionsPrivate.h"
22
22
#import " NSMethodSignature+OCMAdditions.h"
23
- # import " NSObject+OCMAdditions.h "
23
+
24
24
25
25
#if (TARGET_OS_OSX && (!defined(__MAC_10_10) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_10)) || \
26
26
(TARGET_OS_IPHONE && (!defined(__IPHONE_8_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0))
@@ -30,6 +30,7 @@ static BOOL OCMObjectIsClass(id object) {
30
30
#define object_isClass OCMObjectIsClass
31
31
#endif
32
32
33
+
33
34
@implementation NSInvocation (OCMAdditions)
34
35
35
36
+ (NSInvocation *)invocationForBlock : (id )block withArguments : (NSArray *)arguments
@@ -65,7 +66,7 @@ - (void)retainObjectArgumentsExcludingObject:(id)objectToExclude
65
66
NSMutableArray *retainedArguments = [[NSMutableArray alloc ] init ];
66
67
67
68
id target = [self target ];
68
- if ((target != nil ) && (target != objectToExclude) && !object_isClass (target) && ![ target _isDeallocating ] )
69
+ if ((target != nil ) && (target != objectToExclude) && !object_isClass (target) && !OCMIsDeallocating ( target) )
69
70
{
70
71
// Bad things will happen if the target is a block since it's not being
71
72
// copied. There isn't a very good way to tell if an invocation's target
@@ -83,7 +84,7 @@ - (void)retainObjectArgumentsExcludingObject:(id)objectToExclude
83
84
{
84
85
id argument;
85
86
[self getArgument: &argument atIndex: index ];
86
- if ((argument != nil ) && (argument != objectToExclude) && ![ argument _isDeallocating ] )
87
+ if ((argument != nil ) && (argument != objectToExclude) && !OCMIsDeallocating ( argument) )
87
88
{
88
89
if (OCMIsBlockType (argumentType))
89
90
{
@@ -105,7 +106,7 @@ - (void)retainObjectArgumentsExcludingObject:(id)objectToExclude
105
106
{
106
107
id returnValue;
107
108
[self getReturnValue: &returnValue];
108
- if ((returnValue != nil ) && (returnValue != objectToExclude) && ![ returnValue _isDeallocating ] )
109
+ if ((returnValue != nil ) && (returnValue != objectToExclude) && !OCMIsDeallocating ( returnValue) )
109
110
{
110
111
if (OCMIsBlockType (returnType))
111
112
{
0 commit comments