advertisement

Article:
  Memory Management in Objective-C
Subject:   Having trouble releasing
Date:   2007-06-25 13:12:25
From:   dwarnold45
Hi,


Open your project file in xcode and responded "Upgrade a Copy." Made the following changes to Controller.m.


#import "Controller.h"


@implementation Controller


- (IBAction)goButton:(id)sender
{
AClass *ourObject;
ourObject = [AClass alloc];

// do stuff with ourObject

[ourObject release];
ourObject=nil;
}


@end


Rebuilt in xcode.


Found ObjectAlloc on my system where you said it would be. Ran it. From the File->Run menu, selected MemApp/Build/MemApp.app and started it in ObjectAlloc.


My difficulty is that AClass shows this:


Current: 4
Peak: 4
Total: 4


I see no evidence of "releasing." Anyone else experience this behavior.


Mac os x 10.4.10 and xcode 2.4.1 and ObjectAlloc 3.4.


Thanks.