นี่คือรหัสของฉัน:
@interface TabRegsViewController ()
@end
@implementation TabRegsViewController
@synthesize parent;
@synthesize menu_select;
-(BOOL) shouldAutorotate {
return UIInterfaceOrientationMaskPortrait;
}
-(NSUInteger) supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad {
NSLog(@"***************\t\t\tTab_Reg_ViewDidLoad");
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidAppear:(BOOL)animated {
//[super viewDidAppear:animated];
NSLog(@"***************\t\t\tTab_Reg_ViewDidAppear");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
UI นี้สร้างเฉพาะสตอรี่บอร์ดเท่านั้น
สตอรี่บอร์ดนี้เล่นได้ใน iPhone 5 แต่ iPhone 6 Plus ของฉันไม่สามารถเล่นได้
************* tab_reg_ViewDidload
กำลังยุติแอปเพื่อรับข้อยกเว้นที่ไม่ถูกตรวจจับ
'NSInvalidArgumentException' เหตุผล: '*** - [__NSPlaceholderArray initWithObjects: count: ]: พยายามแทรกวัตถุไม่มีจากวัตถุ [0]'
ผมไม่ทราบว่าจะทำอย่างไร.
หลังจากเหตุการณ์ปุ่มคลาสพาเรนต์เกิดขึ้น เหตุการณ์ presentViewController
จะเกิดขึ้นและเพจจะเปลี่ยนไป
iPhone 5 ใช้งานได้ แต่ iPhone 6 plus ล้มเหลว
ฉันคิดว่า TabRegsViewController
viewDidLoad
นี้ใช้ได้ แต่เป็นข้อยกเว้น
ฉันไม่รู้วิธีล้างข้อยกเว้นนี้
โปรดช่วยฉันด้วย
แก้ไข :
วิธีการ Class Call นี้ และตัวชี้ vc และ self นี้มีค่าเป็นศูนย์ ทำไม?..
UIStoryboard *storyboard = [UIStroyboard storyboardWithName:"Main_Storyboard" bundle:nil];
TabRegsViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"TabRegsViewController"];
vc.parent = self;
[self presentViewController:vc animated:NO completion:nil];
และจุดยกเว้นในปัจจุบันคือ
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromclass([Appdelegate class]));
}
}
ข้อผิดพลาดคือเธรด 1: สัญญาณ SIGABRT argc (int) argv = (ถ่านที่ไม่ได้ลงชื่อ ** ) NULL
viewDidLoad
และviewDidAppear:
ของคุณจึงไม่เรียกsuper
- person rmaddy   schedule 13.04.2015