simonb/SBTableAlert — Issue #6: Alternative to block-based notification handler
Author: jpm
Created: 2011-10-29 02:04:19+00:00
State: open

Simon,

Great library, thanks for sharing it. Everything seems to work great, but I need a version of the library that wouldn't depend on blocks, as my client sadly requires support for iOS 3 still. I tried replacing the following bit:

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

with this:

// ...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged)
name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
// ...

- (void)orientationChanged {
[self layout];
}

But the orientation magic doesn't work the same way, and the table view shows up outside the alert view when switching orientations.

Is this something that can be tweaked?

Regards,
--Joao