Skip to content
This repository
Browse code

Merge pull request #11 from mapedd/master

Fixed crash
  • Loading branch information...
commit 87c91b5c0415829cc4346c394fd9c017cd1dca13 2 parents c96f6ad + 2091b23
Simon Blommegård authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. 8  SBTableAlert.m
8  SBTableAlert.m
@@ -273,9 +273,7 @@ - (id)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle
273 273
 		[_alertView addSubview:_shadow];
274 274
 		[_alertView bringSubviewToFront:_shadow];
275 275
 		
276  
-		[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidChangeStatusBarOrientationNotification object:nil queue:nil usingBlock:^(NSNotification *n) {
277  
-			dispatch_after(DISPATCH_TIME_NOW, dispatch_get_main_queue(), ^{[self layout];});
278  
-		}];
  276
+		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(layoutAfterSomeTime) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
279 277
 	}
280 278
 	
281 279
 	return self;
@@ -410,6 +408,10 @@ - (void)layout {
410 408
 															 8)];
411 409
 }
412 410
 
  411
+- (void)layoutAfterSomeTime{
  412
+    [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(layout) userInfo:nil repeats:NO];
  413
+}
  414
+
413 415
 #pragma mark -
414 416
 #pragma mark UITableViewDelegate
415 417
 

0 notes on commit 87c91b5

Please sign in to comment.
Something went wrong with that request. Please try again.