12#define VerboseLog NSLog
14#define VerboseLog(...) do {} while (0)
21+ (id)initWithObject:(
id<NSObject>)object name:(NSString *)name;
22+ (id)initWithRetainedObject:(
id<NSObject>)object name:(NSString *)name;
33+ (id)proxyWithObject:(
id<NSObject>)object name:(NSString *)name
35 return [[[
self alloc] initWithObject:object name:name] autorelease];
39+ (id)proxyWithRetainedObject:(
id<NSObject>)object name:(NSString *)name
41 return [[[
self alloc] initWithRetainedObject:object name:name] autorelease];
45- (id)initWithObject:(
id<NSObject>)object name:(NSString *)name
47 return [
self initWithRetainedObject:[object retain] name:name];
51- (id)initWithRetainedObject:(
id<NSObject>)object name:(NSString *)name
55 NSLog(
@"** ReleaseLockProxy: passed nil object, returning nil proxy.");
74 NSLog(
@"** ReleaseLockProxy (%@): deallocated while locked. This shouldn't happen, unless -dealloc is being called directly.", [
self rlpObjectDescription]);
104 unsigned retainCount = [
self retainCount];
106 if (
_locked && retainCount == 1)
109 NSLog(
@"** ReleaseLockProxy (%@): released while locked and retain count is one - intercepting retain. Something is broken.", [
self rlpObjectDescription]);
115 VerboseLog(
@"-- ReleaseLockProxy (%@): released while locked, but retain count > 1; retain count going from %u to %u.", [
self rlpObjectDescription], retainCount, retainCount - 1);
119 VerboseLog(
@"-- ReleaseLockProxy (%@): released while not locked; retain count going from %u to %u.", [
self rlpObjectDescription], retainCount, retainCount - 1);
129 return [
super autorelease];
135- (void)forwardInvocation:(NSInvocation *)invocation
137 [invocation invokeWithTarget:_object];
141- (NSMethodSignature *)methodSignatureForSelector:(
SEL)selector
143 NSMethodSignature *result =
nil;
145 if (selector ==
@selector(initWithObject:name:) ||
146 selector ==
@selector(initWithRetainedObject:name:) ||
154 result = [(id)_object methodSignatureForSelector:selector];
161+ (BOOL)instancesRespondToSelector:(
SEL)selector
163 if (selector ==
@selector(initWithObject:name:) ||
164 selector ==
@selector(initWithRetainedObject:name:) ||
177- (BOOL)respondsToSelector:(
SEL)selector
187+ (id)initWithObject:(
id<NSObject>)object name:(NSString *)name {
return nil; }
188+ (id)initWithRetainedObject:(
id<NSObject>)object name:(NSString *)name {
return nil; }
#define NSLog(format,...)
NSString * rlpObjectDescription()
BOOL instancesRespondToSelector:(SEL selector)
NSString * rlpObjectDescription()