From ba8cf5017590a748e703cd0cc8a0e837ec708a5f Mon Sep 17 00:00:00 2001 From: Marshall Huss Date: Sat, 25 Feb 2012 23:43:12 -0500 Subject: [PATCH] Fixed memory leak --- BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m b/BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m index 72d4c71..022d26a 100644 --- a/BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m +++ b/BlockAlertsDemo/ToAddToYourProjects/BlockTextPromptAlertView.m @@ -39,7 +39,7 @@ - (id)initWithTitle:(NSString *)title message:(NSString *)message defaultText:(N self = [super initWithTitle:title message:message]; if (self) { - UITextField *theTextField = [[UITextField alloc] initWithFrame:CGRectMake(kTextBoxHorizontalMargin, _height, _view.bounds.size.width - kTextBoxHorizontalMargin * 2, kTextBoxHeight)]; + UITextField *theTextField = [[[UITextField alloc] initWithFrame:CGRectMake(kTextBoxHorizontalMargin, _height, _view.bounds.size.width - kTextBoxHorizontalMargin * 2, kTextBoxHeight)] autorelease]; [theTextField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; [theTextField setAutocapitalizationType:UITextAutocapitalizationTypeWords];