Re: [SOLVED] NSObject Category
Re: [SOLVED] NSObject Category
- Subject: Re: [SOLVED] NSObject Category
- From: Marco Maniscalco <email@hidden>
- Date: Sun, 21 Aug 2005 15:31:02 +0200
*Hello Guys,
I just solved the problem. This code *rocks* ... imagine what you can do
with that... I will write my
project-internal memory manager that tells me what haven't been
deallocated till a given timeline.
@implementation NSObject(Observer)
- (id)init
{
if(self != nil)
{
NSLog( @"Allocated: %@",NSStringFromClass([self class]) );
}
return self;
}
- (void)dealloc
{
if(self != nil)
{
NSLog( @"Deallocated: %@",NSStringFromClass([self class]) );
}
}
@end
Greets, Marco
*Marco Maniscalco wrote:
Hello Guys,
I'm curious if I am allowed to extend NSObject!? I have some leaks
which are not easy to track (network-related).
So my idea is to extend NSObject's -(id)init; method to keep track if
(and when) an object of specific type ist beeing deallocated.
I'm getting 10 (SIGBUS) if I NSLog() status to console. If there is no
MSLog() the error occurs. Any ideas?
@implementation NSObject(Observer)
- (id)init
{
if(self != nil)
NSLog(@"observed init: %@", [self description]); return self;
}
@end
Greets, Marco Maniscalco
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden