very simple code, but leaks as hell... check it out.
- (void)loadView {
NSString * myTitle = @"HELLO";
NSString * message = @"\nThis stuff is leaking!\n";
NSString * cancelButton = @"Dismiss";
NSString * otherTitles = nil;
[self showAlert: myTitle : message: cancelButton : otherTitles];
}
- (void) showAlert: (NSString *) titulo : (NSString *) mensagem : (NSString *) cancelButton : (NSString *) otherButton {
UIAlertView * alertView = nil;
if (otherButton) {
alertView = [[UIAlertView alloc]
initWithTitle:titulo
message:mensagem
delegate:self cancelButtonTitle:cancelButton
otherButtonTitles:otherButton, nil ];
} else {
alertView = [[UIAlertView alloc]
initWithTitle:titulo
message:mensagem
delegate:self cancelButtonTitle:cancelButton
otherButtonTitles:nil ];
}
[alertView show];
[alertView release];
}
Here is the project, if you wanna try for yourself on instruments... http://www.mediafire.com/download.php?hml2hl5laz9ez2j
How do I solve that?
thanks.