久久久久久久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>

        如何檢查視圖控制器是否可以執(zhí)行轉(zhuǎn)場

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

          <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>

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

                  問題描述

                  限時送ChatGPT賬號..

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

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

                  我正在嘗試找出一種方法來檢查某個視圖控制器是否可以在調(diào)用 performSegueWithIdentifier: 方法之前執(zhí)行帶有標識符 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"];
                  

                  可能嗎?

                  推薦答案

                  如文檔所述:

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

                  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.

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

                  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.

                  話雖如此,當您觸發(fā) segue 時,通常是因為假設 UIViewController 將能夠使用特定的 segue's 標識符.我也同意 Dan F,您應該盡量避免可能引發(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:.要實際檢查一個方法是否能夠處理帶有某些參數(shù)的消息,我想這是不可能的,因為為了確定是否有可能它必須實際運行它,并且在這樣做時 NSInvalidArgumentException會上升.
                  2. 要實際創(chuàng)建您建議的內(nèi)容,接收 UIViewController 關(guān)聯(lián)的 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

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

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

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

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

                  相關(guān)文檔推薦

                  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(圖標已經(jīng)包含光澤效果)
                  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>

                          • 主站蜘蛛池模板: 麻豆av网站 | 精品国产色 | 狠狠操av | 亚洲高清视频在线 | 91精品国产一区二区三区 | 国产一区成人 | 91久久精品一区二区三区 | 涩涩导航| 久久久91 | 精品网| 亚洲不卡在线观看 | 粉嫩在线 | 中日韩毛片 | 99中文字幕 | 亚洲精品在线观看网站 | 很很干很很日 | 在线欧美小视频 | 黄色免费观看网站 | 久久国色 | 最近日韩中文字幕 | 欧美四虎 | 一区二区三区免费 | 国产高清一区二区 | 天天插天天搞 | 亚洲精品国产综合区久久久久久久 | av一区二区三区 | 一区二区三区四区不卡视频 | 最新国产福利在线 | 91网在线观看 | 欧美一区二区在线免费观看 | 精品在线一区 | ww 255hh 在线观看 | 91高清免费| 91看片免费版| 久久夜视频 | 亚洲综合免费 | 新av在线| 色婷婷一区二区三区四区 | 久草青青草 | 爱操影视| 中文字幕日韩欧美一区二区三区 |