• <bdo id='0M5lc'></bdo><ul id='0M5lc'></ul>
    1. <i id='0M5lc'><tr id='0M5lc'><dt id='0M5lc'><q id='0M5lc'><span id='0M5lc'><b id='0M5lc'><form id='0M5lc'><ins id='0M5lc'></ins><ul id='0M5lc'></ul><sub id='0M5lc'></sub></form><legend id='0M5lc'></legend><bdo id='0M5lc'><pre id='0M5lc'><center id='0M5lc'></center></pre></bdo></b><th id='0M5lc'></th></span></q></dt></tr></i><div id='0M5lc'><tfoot id='0M5lc'></tfoot><dl id='0M5lc'><fieldset id='0M5lc'></fieldset></dl></div>
      <legend id='0M5lc'><style id='0M5lc'><dir id='0M5lc'><q id='0M5lc'></q></dir></style></legend>
    2. <small id='0M5lc'></small><noframes id='0M5lc'>

    3. <tfoot id='0M5lc'></tfoot>

      UIStoryboardPopoverSegue 在按钮触摸时打开多个窗口

      时间:2023-06-01

          <small id='sUxJ8'></small><noframes id='sUxJ8'>

          <legend id='sUxJ8'><style id='sUxJ8'><dir id='sUxJ8'><q id='sUxJ8'></q></dir></style></legend>
          <i id='sUxJ8'><tr id='sUxJ8'><dt id='sUxJ8'><q id='sUxJ8'><span id='sUxJ8'><b id='sUxJ8'><form id='sUxJ8'><ins id='sUxJ8'></ins><ul id='sUxJ8'></ul><sub id='sUxJ8'></sub></form><legend id='sUxJ8'></legend><bdo id='sUxJ8'><pre id='sUxJ8'><center id='sUxJ8'></center></pre></bdo></b><th id='sUxJ8'></th></span></q></dt></tr></i><div id='sUxJ8'><tfoot id='sUxJ8'></tfoot><dl id='sUxJ8'><fieldset id='sUxJ8'></fieldset></dl></div>
            <bdo id='sUxJ8'></bdo><ul id='sUxJ8'></ul>
                <tbody id='sUxJ8'></tbody>
              • <tfoot id='sUxJ8'></tfoot>
                本文介绍了UIStoryboardPopoverSegue 在按钮触摸时打开多个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我正在使用 UIStoryboardPopoverSegue 来呈现 iOS 5 iPad 应用的弹出框.Segue 效果很好,但似乎包含按钮的工具栏是弹出框控制器的直通视图,因此如果您继续按下按钮,则会出现更多弹出框.由于我自己没有创建和跟踪 UIPopoverController (正如故事板所做的那样),当再次触摸按钮时我无法关闭它.有没有其他人遇到过这个?我向 Apple 提出了一个错误,但他们没有回应.

                I'm using a UIStoryboardPopoverSegue to present a popover for an iOS 5 iPad app. The Segue works great, but it seems like the toolbar that contains the button is a passthrough view for the popover controller so if you keep pressing the button, more popovers appear. As I'm not creating and keeping track of the UIPopoverController myself (as the Storyboard is doing it) I can't dismiss it when the button is touched again. Has anyone else run into this? I have a bug open with Apple but they haven't responded.

                编辑:我已经使用下面的答案解决了这个问题.这是我最终使用的代码.currentPopover 是我的视图控制器类中的一个 __weak ivar,所以当控制器完成时它会自动下降到 nil.

                EDIT: I've solved this using the answer below. Here is the code I ended up using. currentPopover is a __weak ivar in my view controller class, so when the controller is done it will drop to nil automatically.

                - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
                    if([segue isKindOfClass:[UIStoryboardPopoverSegue class]]){
                        // Dismiss current popover, set new popover
                        [currentPopover dismissPopoverAnimated:YES];
                        currentPopover = [(UIStoryboardPopoverSegue *)segue popoverController];
                    }
                }
                

                推荐答案

                您必须存储对作为 UIStoryboardPopoverSegue 类的一部分传递的 popoverController 属性的引用prepareForSegue 类方法.

                You have to store a reference to the popoverController property passed as part of the UIStoryboardPopoverSegue class in the prepareForSegue class method.

                要访问它,请像这样覆盖调用视图控制器中的方法:

                To access it, over-ride the method in the calling view controller like this:

                - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
                {
                    // The Storyboard Segue is named popover in this case:
                    if ([segue.identifier compare:@"popover"] == NSOrderedSame) {
                        // segue.popoverController is only present in popover segue's
                        // self.seguePopoverController is a UIPopoverController * property.
                        self.seguePopoverController = segue.popoverController;
                    }
                }
                

                然后你可以用通常的方式关闭它.

                Then you can dismiss it in the usual way.

                这篇关于UIStoryboardPopoverSegue 在按钮触摸时打开多个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:SecTrustEvaluate 始终使用 SecPolicyCreateSSL 返回 kSecT 下一篇:在大型 UIScrollView 中直观地排列子视图

                相关文章

                最新文章

              • <small id='Mvkpa'></small><noframes id='Mvkpa'>

                  <bdo id='Mvkpa'></bdo><ul id='Mvkpa'></ul>
                <i id='Mvkpa'><tr id='Mvkpa'><dt id='Mvkpa'><q id='Mvkpa'><span id='Mvkpa'><b id='Mvkpa'><form id='Mvkpa'><ins id='Mvkpa'></ins><ul id='Mvkpa'></ul><sub id='Mvkpa'></sub></form><legend id='Mvkpa'></legend><bdo id='Mvkpa'><pre id='Mvkpa'><center id='Mvkpa'></center></pre></bdo></b><th id='Mvkpa'></th></span></q></dt></tr></i><div id='Mvkpa'><tfoot id='Mvkpa'></tfoot><dl id='Mvkpa'><fieldset id='Mvkpa'></fieldset></dl></div>

                  1. <tfoot id='Mvkpa'></tfoot><legend id='Mvkpa'><style id='Mvkpa'><dir id='Mvkpa'><q id='Mvkpa'></q></dir></style></legend>