【发布时间】:2009-09-19 05:46:22
【问题描述】:
我有这个方法但是我应该把这个方法放在哪里???
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(receivedRotate:) name: UIDeviceOrientationDidChangeNotification
object: nil];
// This method is called by NSNotificationCenter when the device is rotated.
-(void) receivedRotate: (NSNotification*) notification
{
UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];
if(interfaceOrientation != UIDeviceOrientationUnknown)
[self deviceInterfaceOrientationChanged:interfaceOrientation];
}
【问题讨论】:
标签: iphone