0
我有一個帶有pdf的UIviewController。我在另一個屏幕上使用該方向來顯示PDF。該方向運行良好三次,然後該應用程序掛起以下警告。三次定位後掛起的應用程序
[切換處理11779螺紋爲0x0]
[切換處理13059螺紋爲0x0]
[切換處理11779螺紋爲0x0]
這是什麼說? 請找到下面的代碼。
- (void)viewDidLoad
{
self.view.backgroundColor = [UIColor clearColor];
pdfURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"pdf"]];
[webView loadRequest:[NSURLRequest requestWithURL:pdfURL]];
thisDevice = [UIDevice currentDevice];
[thisDevice beginGeneratingDeviceOrientationNotifications];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectOrientation) name:UIDeviceOrientationDidChangeNotification object:nil];
[self setTitle:@"1 Of 1"];
[super viewDidLoad];
}
-(void) detectOrientation
{
if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) ||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)) {
//load view 2
IdcardVC *ids = [[IdcardVC alloc] initWithNibName:@"IdcardVC" bundle:nil];
[self.navigationController presentModalViewController:ids animated:YES];
[ids release];
}
else if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait) {
[self dismissModalViewControllerAnimated:NO];
}
任何幫助表示讚賞。 謝謝