久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='GZny5'></tfoot>

  • <i id='GZny5'><tr id='GZny5'><dt id='GZny5'><q id='GZny5'><span id='GZny5'><b id='GZny5'><form id='GZny5'><ins id='GZny5'></ins><ul id='GZny5'></ul><sub id='GZny5'></sub></form><legend id='GZny5'></legend><bdo id='GZny5'><pre id='GZny5'><center id='GZny5'></center></pre></bdo></b><th id='GZny5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GZny5'><tfoot id='GZny5'></tfoot><dl id='GZny5'><fieldset id='GZny5'></fieldset></dl></div>
  • <legend id='GZny5'><style id='GZny5'><dir id='GZny5'><q id='GZny5'></q></dir></style></legend>

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

    • <bdo id='GZny5'></bdo><ul id='GZny5'></ul>

        如何檢查視圖控制器是否可以執行轉場

        How to check if a view controller can perform a segue(如何檢查視圖控制器是否可以執行轉場)

          <legend id='5BgUz'><style id='5BgUz'><dir id='5BgUz'><q id='5BgUz'></q></dir></style></legend>
            <bdo id='5BgUz'></bdo><ul id='5BgUz'></ul>
            <i id='5BgUz'><tr id='5BgUz'><dt id='5BgUz'><q id='5BgUz'><span id='5BgUz'><b id='5BgUz'><form id='5BgUz'><ins id='5BgUz'></ins><ul id='5BgUz'></ul><sub id='5BgUz'></sub></form><legend id='5BgUz'></legend><bdo id='5BgUz'><pre id='5BgUz'><center id='5BgUz'></center></pre></bdo></b><th id='5BgUz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5BgUz'><tfoot id='5BgUz'></tfoot><dl id='5BgUz'><fieldset id='5BgUz'></fieldset></dl></div>
                <tbody id='5BgUz'></tbody>

              <small id='5BgUz'></small><noframes id='5BgUz'>

              <tfoot id='5BgUz'></tfoot>

                • 本文介紹了如何檢查視圖控制器是否可以執行轉場的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  這可能是一個非常簡單的問題,但在搜索時沒有產生任何結果,所以在這里......

                  This might be a very simple question but didn't yield any results when searching for it so here it is...

                  我正在嘗試找出一種方法來檢查某個視圖控制器是否可以在調用 performSegueWithIdentifier: 方法之前執行帶有標識符 XYZ 的 segue.

                  I am trying to work out a way to check if a certain view controller can perform a segue with identifier XYZ before calling the performSegueWithIdentifier: method.

                  類似的東西:

                  if ([self canPerformSegueWithIdentifier:@"SegueID"])
                      [self performSegueWithIdentifier:@"SegueID"];
                  

                  可能嗎?

                  推薦答案

                  如文檔所述:

                  應用程序通常不需要直接觸發 segue.相反,您在 Interface Builder 中配置一個與視圖控制器,例如嵌入在其視圖層次結構中的控件,觸發segue.但是,您可以調用此方法來觸發以編程方式進行 segue,也許是為了響應某些無法執行的操作在情節提要資源文件中指定.例如,您可能從用于處理抖動的自定義操作處理程序調用它或加速度計事件.

                  Apps normally do not need to trigger segues directly. Instead, you configure an object in Interface Builder associated with the view controller, such as a control embedded in its view hierarchy, to trigger the segue. However, you can call this method to trigger a segue programmatically, perhaps in response to some action that cannot be specified in the storyboard resource file. For example, you might call it from a custom action handler used to process shake or accelerometer events.

                  收到此消息的視圖控制器必須已加載從故事板.如果視圖控制器沒有關聯的故事板,也許是因為你自己分配和初始化了它,此方法拋出異常.

                  The view controller that receives this message must have been loaded from a storyboard. If the view controller does not have an associated storyboard, perhaps because you allocated and initialized it yourself, this method throws an exception.

                  話雖如此,當您觸發 segue 時,通常是因為假設 UIViewController 將能夠使用特定的 segue's 標識符.我也同意 Dan F,您應該盡量避免可能引發異常的情況.作為你不能做這樣的事情的原因:

                  That being said, when you trigger the segue, normally it's because it's assumed that the UIViewController will be able to respond to it with a specific segue's identifier. I also agree with Dan F, you should try to avoid situations where an exception could be thrown. As the reason for you not to be able to do something like this:

                  if ([self canPerformSegueWithIdentifier:@"SegueID"])
                      [self performSegueWithIdentifier:@"SegueID"];
                  

                  我猜:

                  1. respondsToSelector: 僅檢查您是否能夠在運行時處理該消息.在這種情況下你可以,因為類 UIViewController 能夠響應 performSegueWithIdentifier:sender:.要實際檢查一個方法是否能夠處理帶有某些參數的消息,我想這是不可能的,因為為了確定是否有可能它必須實際運行它,并且在這樣做時 NSInvalidArgumentException會上升.
                  2. 要實際創建您建議的內容,接收 UIViewController 關聯的 segue id 列表會很有幫助.從 UIViewController 文檔,我找不到任何類似的東西
                  1. respondsToSelector: only checks if you are able to handle that message in runtime. In this case you can, because the class UIViewController is able to respond to performSegueWithIdentifier:sender:. To actually check if a method is able to handle a message with certain parameters, I guess it would be impossible, because in order to determine if it's possible it has to actually run it and when doing that the NSInvalidArgumentException will rise.
                  2. To actually create what you suggested, it would be helpful to receive a list of segue's id that the UIViewController is associated with. From the UIViewController documentation, I wasn't able to find anything that looks like that

                  就目前而言,我猜你最好的選擇是繼續使用 @try @catch @finally.

                  As for now, I am guessing your best bet it's to keep going with the @try @catch @finally.

                  這篇關于如何檢查視圖控制器是否可以執行轉場的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標已經包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))

                      <tbody id='2Pv1m'></tbody>

                    <small id='2Pv1m'></small><noframes id='2Pv1m'>

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

                    <legend id='2Pv1m'><style id='2Pv1m'><dir id='2Pv1m'><q id='2Pv1m'></q></dir></style></legend>

                      <bdo id='2Pv1m'></bdo><ul id='2Pv1m'></ul>
                    • <tfoot id='2Pv1m'></tfoot>

                          • 主站蜘蛛池模板: 人人干视频在线 | 国产 日韩 欧美 中文 在线播放 | www.4567| 久久香焦 | 欧美黑人激情 | 久久综合av | 91看片官网 | 黑人巨大精品欧美一区二区免费 | 国产婷婷色一区二区三区 | 欧美极品在线观看 | 一区二区三区日韩 | 男插女下体视频 | 成人区精品一区二区婷婷 | 鸳鸯谱在线观看高清 | 国产视频二区 | 搞av.com| 日日日操 | 亚洲精品久久嫩草网站秘色 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 91国产精品在线 | 亚洲国产免费 | 涩涩视频在线播放 | 日韩精品在线观看免费 | 一级片在线免费播放 | 欧美精品久久久久久久久老牛影院 | 日本在线观看网址 | 天天综合久久网 | 福利社午夜影院 | 日韩一区二区三区视频 | 麻豆精品一区二区三区在线观看 | 黄色免费看 | 精品一区精品二区 | 操皮视频| 久久久久国产一区二区三区 | 久久国产精品首页 | 国产精品久久久久久婷婷天堂 | 国产三级| 亚洲国产精品一区二区第一页 | 国产精品精品视频一区二区三区 | 国产在线观 | 天天综合国产 |