xcode의 page-based
프로젝트에 새 페이지를 추가하려는 경우 DataViewController
이 전체 화면을 차지하므로 RootVC
에 아무 버튼도 추가 할 수 없습니다.UIPageViewController에서 새 페이지를 추가하려고 할 때
중단
스레드 1, 코드 말한다 이유는
DataVC
에IBAction
을 추가 할 때, 충돌이, 이해가 안 돼요//in DataVC, not sure if it is ok to create the DataVC inside itself - (IBAction)addOne:(id)sender { DataViewController *dvc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"DataViewController"]; [[ModelController sharedModelController] addOneToModel:dvc]; } //in ModelController -(void) addOneToModel:(DataViewController*)dvc{ [self.pageData addObject:dvc];//ERROR HERE: not much details : "thread 1, breakpoint 1.1" } //the sharedMOdelController +(instancetype)sharedModelController{ static dispatch_once_t once; static ModelController *sharedInstance; dispatch_once(&once, ^{ sharedInstance = [[ModelController alloc] init]; }); return sharedInstance; }
어떻게 pageViewController를 사용합니까, 어떻게 viewControllers 속성을 설정합니까, 어떻게 데이터 소스를 사용합니까, 일부 소스 코드를 넣을 수 있습니까? 넣은 코드에는 흥미로운 것이 없습니다. – Sandeep
감사합니다. @ insane-36은 xcode를 기반으로 새 페이지를 만들 때 제공되는 프로젝트였습니다. 위의 코드를 추가하기 만하면되지만, 가변 배열의 경우 "copy"대신 "mutableCopy"를 사용해야합니다. 고맙습니다. 어쨌든 – Paul