views:

29

answers:

0

I'm writing an Eiffel wrapper for AppKit and Foundation and I need to hijack all -dealloc methods.

Thanks to the dynamic nature of Objective-C it is pretty easy to do that. But the problem is it only works with some of the Foundation or AppKit objects. There are certain objects (e.g. NSString, NSArray, NSDate, ...) that are actually CF objects so the dealloc method doesn't get called. Instead the deallocate callbacks of the allocator that allocated the CF object is called. Is there a way to intercept that?