Skip to content

Commit

Permalink
Merge pull request #11 from mapedd/master
Browse files Browse the repository at this point in the history
Fixed crash
  • Loading branch information
blommegard committed Mar 30, 2012
2 parents c96f6ad + 2091b23 commit 87c91b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SBTableAlert.m
Expand Up @@ -273,9 +273,7 @@ - (id)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle
[_alertView addSubview:_shadow];
[_alertView bringSubviewToFront:_shadow];

[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidChangeStatusBarOrientationNotification object:nil queue:nil usingBlock:^(NSNotification *n) {
dispatch_after(DISPATCH_TIME_NOW, dispatch_get_main_queue(), ^{[self layout];});
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(layoutAfterSomeTime) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}

return self;
Expand Down Expand Up @@ -410,6 +408,10 @@ - (void)layout {
8)];
}

- (void)layoutAfterSomeTime{
[NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(layout) userInfo:nil repeats:NO];
}

#pragma mark -
#pragma mark UITableViewDelegate

Expand Down

0 comments on commit 87c91b5

Please sign in to comment.