Reputation: 5510
I have created a device orientation listener to catch when the device is rotated, like so
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(jumpBarButtonPosition)
name:@"UIDeviceOrientationDidChangeNotification" object:nil];
however inside the jumpBarButtonPosition method I have changed from using UIDeviceOrientation to statusBarOrientation, so I am woundering what I could replace UIDeviceOrientationDidChangeNotification with in order to only receive notifications about the statudBarOrientation changes.
Upvotes: 1
Views: 940
Reputation: 4061
Don't type it as a string:@"UIDeviceOrientationDidChangeNotification" use:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(jumpBarButtonPosition)
name:UIDeviceOrientationDidChangeNotification object:nil];
Upvotes: 1