diff --git a/LMAlertView/LMAlertView.m b/LMAlertView/LMAlertView.m index 2ad40d3..39f5779 100644 --- a/LMAlertView/LMAlertView.m +++ b/LMAlertView/LMAlertView.m @@ -114,7 +114,9 @@ - (void)setButtonsShouldStack:(BOOL)buttonsShouldStack - (void)setTintColor:(UIColor *)tintColor { _tintColor = tintColor; - self.window.tintColor = tintColor; + if ([self.window respondsToSelector:@selector(setTintColor:)]) { + self.window.tintColor = self.tintColor; + } } - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... @@ -430,7 +432,9 @@ - (void)show // You can have more than one UIWindow in the view hierachy, which is how UIAlertView works self.window = [[UIWindow alloc] initWithFrame:[appDelegate window].frame]; - self.window.tintColor = self.tintColor; + if ([self.window respondsToSelector:@selector(setTintColor:)]) { + self.window.tintColor = self.tintColor; + } LMEmbeddedViewController *viewController = [[LMEmbeddedViewController alloc] init]; viewController.alertView = self;