Fixed a retain cycle issue

This commit is contained in:
Mugunth
2013-01-29 19:03:00 +08:00
parent 0e7757e848
commit 0cecdae4cb
2 changed files with 10 additions and 3 deletions

View File

@@ -204,7 +204,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = AH;
LastUpgradeCheck = 0440;
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = "Auerhaus Development, LLC";
};
buildConfigurationList = 80C6F0F915FE54A900ABF313 /* Build configuration list for PBXProject "AHAlertViewSample" */;
@@ -279,6 +279,9 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
@@ -306,6 +309,9 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;

View File

@@ -99,11 +99,12 @@ static const NSInteger kAHViewAutoresizingFlexibleMargins =
NSString *message = @"This is a message that might prompt you to do something.";
AHAlertView *alert = [[AHAlertView alloc] initWithTitle:title message:message];
__weak AHAlertView *weakAlert = alert;
[alert setCancelButtonTitle:@"Tumble" block:^{
alert.dismissalStyle = AHAlertViewDismissalStyleTumble;
weakAlert.dismissalStyle = AHAlertViewDismissalStyleTumble;
}];
[alert addButtonWithTitle:@"Zoom Down" block:^{
alert.dismissalStyle = AHAlertViewDismissalStyleZoomDown;
weakAlert.dismissalStyle = AHAlertViewDismissalStyleZoomDown;
}];
[alert show];
}