Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lordsith

macrumors newbie
Original poster
Oct 24, 2009
2
0
Hello everybody ... :)

I Have two NSTextField in my project but when I introduces a word , starting to leaks, I checked in the Instruments -> Leaks

I Add this code for my ControladorRegistro.h

@property (nonatomic, retain) IBOutlet NSTextField * correoCampo;
@property (nonatomic, retain) IBOutlet NSSecureTextField * contrasenaCampo;

And this one in ControladorRegistro.m

@synthesize correoCampo;
@synthesize contrasenaCampo;

- (void)dealloc
{
correoCampo.release;
contrasenaCampo.release;
[super dealloc];

}

But the problem still after included that ... I have screenshot

SCREENSHOOT

I hope anyone can help me .. Thanks ... ( Sorry for mi bad english :p )
 
That code doesn't look like it should compile:
You're dealloc should be:
Code:
- (void) dealloc {
	[correoCampo release];
	[contrasenaCampo release];
	[super dealloc];
}

If something else is the problem, you can use Instruments to discover what method is causing the leaks, by clicking the next button to the right of the blue one selected on the bottom edge of the window, the one with three horizontal lines. A table will come up showing the method stack at the time of the leak. Usually the method nearest the top of the stack, and part of your application, will be responsible for the leak.

You can also catch many potential leaks (though not this particular one) before you even run by using the Static Analyzer during your compile. You must open your build options, change the compiler to CLang, and check the box next to Run Static Analyzer.
 
You can't send the selector release via the . syntax.

Also, its good practice to have a method that looks like this in addition to your dealloc releases.

- (void) viewDidUnload {
self.correoCamp = nil;
self.constrasenaCampo = nil;
}

In UIViewControllers that have subviews, this uses the @property setter to release the view it currently holds. Remember you can send messages to nil at runtime without generating an exception.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.