• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED] NSObject Category
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >NSObject Category (From: Marco Maniscalco <email@hidden>)

  • Prev by Date: NSObject Category
  • Next by Date: Re: NSObject Category
  • Previous by thread: NSObject Category
  • Next by thread: Re: NSObject Category
  • Index(es):
    • Date
    • Thread