的差異,代碼如下:什麼是我創建了一個名爲「YLJTestViewController」由Interface Builder的ViewController pushViewController和addSubview
-(IBAction)DoneButtonPressed:(id)sender
{
YLJTestViewController *testViewController = [[YLJTestViewController alloc]initWithNibName:@"YLJTestViewController" bundle:nil];
[self.navigationController pushViewController:testViewController animated:YES];
//[self.view addSubview:testViewController.view];
}
但是當我使用[self.view addSubview:textViewController.view];
墜毀,但使用[self.navigationController pushViewController:testViewController animated:YES];
它工作得很好,所以什麼?區別我認爲他們是相同的......
如果您從其他來源複製語言,則必須正確引用它們。我在這裏做過,但請在將來做這件事,否則這將被認爲是抄襲。 –