CustomPopoverController不是UIVIEwController,而是有一个名为“contentVIEwController”的ivar,它实际上是显示的VC.
当用户点击contentVIEwController框架之外的任何地方时,我实现了自己的“dismisspopoverAnimated:”以解除我的自定义d出窗口:
-(voID) dismisspopoverAnimated : (BOol) animated{ // dismissalVIEw is the vIEw that intercept the taps outsIDe. [self.dismissalVIEw removeFromSupervIEw]; self.dismissalVIEw = nil; if (animated) { CGRect newFrame = self.vIEw.frame; // When in landscape Mode the wIDth of the screen is actually the "height" newFrame.origin.y = [UIScreen mainScreen].bounds.size.wIDth; [UIVIEw animateWithDuration:0.5 animations:^{self.vIEw.frame = newFrame;} completion: ^(BOol finished) {if(finished) [self.contentVIEwController.vIEw removeFromSupervIEw];}]; } else { [self.contentVIEwController.vIEw removeFromSupervIEw]; } isPresented = NO; [self.delegate customPopoverDIDdismisspopover:self];}
问题是,即使在任何情况下调用removeFromSuperVIEw – 动画与否,在我发布contentVIEwController时,contentVIEwController永远不会收到vIEwWilldisappear,vIEwDIDdisappear甚至vIEwDIDUnload;
有谁知道为什么?
或者甚至更好地在vIEwWill … / vIEwDID …方法链上抛出一些亮点,以及它们应该被调用的时间.
以上是内存溢出为你收集整理的iphone – viewWillDisappear和viewDidDisappear永远不会被调用全部内容,希望文章能够帮你解决iphone – viewWillDisappear和viewDidDisappear永远不会被调用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)