我使用一个pageVIEwController来显示不同的VIEwController。每次pageVIEwController向前移动时,我检查lastPage的输入。如果这是错误的,pageVIEwController应该通过使用setVIEwController方法返回到该页面。没有这种方法一切都可以正常工作,但如果我尝试使用它,应用程序崩溃与以下异常:
19:48:25.596 Phook[23579:60b] *** Assertion failure in -[_UIQueuingScrollVIEw _replaceVIEws:updatingContents:adjustContentInsets:animated:],/SourceCache/UIKit_Sim/UIKit-2935.137/_UIQueuingScrollVIEw.m:383 2014-06-02 19:48:25.600 Phook[23579:60b] *** Terminating app due to uncaught exception 'NSInternalinconsistencyException',reason: 'InvalID parameter not satisfying: [vIEws count] == 3'
这是我的代码:
- (voID)pageVIEwController:(UIPageVIEwController *)pageVIEwController dIDFinishAnimating:(BOol)finished prevIoUsVIEwControllers:(NSArray *)prevIoUsVIEwControllers TransitionCompleted:(BOol)completed{ if (completed && finished) { RegisterUserPageContent* lastPage = (RegisterUserPageContent*)prevIoUsVIEwControllers[ prevIoUsVIEwControllers.count-1]; int lastIndex = lastPage.pageIndex; int newIndex = ((RegisterUserPageContent*)[self.pageVIEwController.vIEwControllers objectAtIndex:0]).pageIndex; if (newIndex > lastIndex) { // Moved Forward if(!lastPage.testinput) { [self.pageVIEwController setVIEwControllers:@[ [self.storyboard instantiateVIEwControllerWithIDentifIEr:_pageStoryBoardIDs[0]] ] direction:UIPageVIEwControllerNavigationDirectionReverse animated:YES completion:nil]; } } else { // Moved Reverse } }}
正如我已经说过的我搜索了很多,并实施了一些解决方案,但没有任何帮助。
谢谢。
dispatch_async(dispatch_get_main_queue(),^{ [self.pageVIEwController setVIEwControllers:@[ [self.storyboard instantiateVIEwControllerWithIDentifIEr:_pageStoryBoardIDs[0]] ] direction:UIPageVIEwControllerNavigationDirectionReverse animated:YES completion:nil];});
希望有帮助!
总结以上是内存溢出为你收集整理的xcode – pageViewController setViewControllers崩溃与“无效参数不满意:[views count] == 3”全部内容,希望文章能够帮你解决xcode – pageViewController setViewControllers崩溃与“无效参数不满意:[views count] == 3”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)