我正在做一件非常簡單的事情。試圖pushViewController。它在iPhone上很好用,但在iPad上,它崩潰了! SIGABRT:pushViewController在iPad上墜毀
libsystem_kernel.dylib`__pthread_kill:
0x35d85324: mov r12, #328
0x35d85328: svc #128
0x35d8532c: blo 0x35d85344 ; __pthread_kill + 32
0x35d85330: ldr r12, [pc, #4] ; __pthread_kill + 24
0x35d85334: ldr r12, [pc, r12]
0x35d85338: b 0x35d85340 ; __pthread_kill + 28
0x35d8533c: stmibeqr4, {r5, r6, r7, r10, r11}
0x35d85340: bx r12
0x35d85344: bx lr
有什麼想法?謝謝!
Principal *cvc;
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"] || [deviceType isEqualToString:@"iPod touch"]) {
cvc = [[Principal alloc] initWithNibName:@"Principal" bundle:nil];
} else {
cvc = [[Principal alloc] initWithNibName:@"Principal_iPad" bundle:nil];
}
[cvc setImg:flippedImage];
if([deviceType isEqualToString:@"iPhone"] || [deviceType isEqualToString:@"iPod touch"]) {
[self.navigationController pushViewController:cvc animated:YES];
} else {
[self.navigationController pushViewController:cvc animated:YES];
}
[cvc release];
你應該使用UI_USER_INTERFACE_IDIOM,而不是比較字符串。 –
現在使用UI_USER_INTERFACE_IDIOM ...但是,無論如何,這不是導致崩潰的原因! –
這就是爲什麼我沒有把它作爲一個解決方案;)只是說... –