Jonathan Sterling
Jonathan Sterling

Reputation: 18375

Can I autorelease an instance of NSProxy?

Does NSProxy really implement -autorelease and -release? If not, do I need to manually dealloc NSProxy instances? (Please assume that I am not using GC).

Thanks for clearing this up for me.

Upvotes: 2

Views: 418

Answers (1)

Ken
Ken

Reputation: 13003

Yes, it implements them. NSProxy conforms to the NSObject protocol, which includes retain, release, and autorelease. NSObject is not just a class, it's also a protocol.

@interface NSProxy <NSObject>

and in the NSObject protocol definition:

- (id)retain;
- (oneway void)release;
- (id)autorelease;

Upvotes: 6

Related Questions