pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="9vvd7dv" 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="5l7777v" 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"];
                  

                  可能嗎?

                  推薦答案

                  如文檔所述:

                  應(yīng)用程序通常不需要直接觸發(fā) segue.相反,您在 Interface Builder 中配置一個與視圖控制器,例如嵌入在其視圖層次結(jié)構(gòu)中的控件,觸發(fā)segue.但是,您可以調(diào)用此方法來觸發(fā)以編程方式進行 segue,也許是為了響應(yīng)某些無法執(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 時,通常是因為假設(shè) UIViewController 將能夠使用特定的 segue's 標識符.我也同意 Dan F,您應(yīng)該盡量避免可能引發(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 能夠響應(yīng) 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="bplvtjd" 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>

                          • 主站蜘蛛池模板: 江西自考网-江西自学考试网| 上海公众号开发-公众号代运营公司-做公众号的公司企业服务商-咏熠软件 | 台式核磁共振仪,玻璃软化点测定仪,旋转高温粘度计,测温锥和测温块-上海麟文仪器 | 洁净实验室工程-成都手术室净化-无尘车间装修-四川华锐净化公司-洁净室专业厂家 | 冷藏车-东风吸污车-纯电动环卫车-污水净化车-应急特勤保障车-程力专汽厂家-程力专用汽车股份有限公司销售二十一分公司 | 油冷式_微型_TDY电动滚筒_外装_外置式电动滚筒厂家-淄博秉泓机械有限公司 | 北京乾茂兴业科技发展有限公司| 聚氨酯催化剂K15,延迟催化剂SA-1,叔胺延迟催化剂,DBU,二甲基哌嗪,催化剂TMR-2,-聚氨酯催化剂生产厂家 | 过跨车_过跨电瓶车_过跨转运车_横移电动平车_厂区转运车_无轨转运车 | 制丸机,小型中药制丸机,全自动制丸机价格-甘肃恒跃制药设备有限公司 | 蒸压釜_蒸养釜_蒸压釜厂家-山东鑫泰鑫智能装备有限公司 | 屏蔽泵厂家,化工屏蔽泵_维修-淄博泵业 | 电机修理_二手电机专家-河北豫通机电设备有限公司(原石家庄冀华高压电机维修中心) | ★济南领跃标识制作公司★济南标识制作,标牌制作,山东标识制作,济南标牌厂 | 东风体检车厂家_公共卫生体检车_医院体检车_移动体检车-锦沅科贸 | 碎石机设备-欧版反击破-欧版颚式破碎机(站)厂家_山东奥凯诺机械 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | OpenI 启智 新一代人工智能开源开放平台 | 合肥制氮机_合肥空压机厂家_安徽真空泵-凯圣精机 | 沟盖板_复合沟盖板厂_电力盖板_树脂雨水篦子-淄博拜斯特 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 厂厂乐-汇聚海量采购信息的B2B微营销平台-厂厂乐官网 | 哲力实业_专注汽车涂料汽车漆研发生产_汽车漆|修补油漆品牌厂家 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 高低温万能试验机-复合材料万能试验机-馥勒仪器| 洛阳装修公司-洛阳整装一站式品牌-福尚云宅装饰 | 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | 热工多功能信号校验仪-热电阻热电偶校验仿真仪-金湖虹润仪表 | 低噪声电流前置放大器-SR570电流前置放大器-深圳市嘉士达精密仪器有限公司 | 对夹式止回阀_对夹式蝶形止回阀_对夹式软密封止回阀_超薄型止回阀_不锈钢底阀-温州上炬阀门科技有限公司 | 网站建设-临朐爱采购-抖音运营-山东兆通网络科技 | TPM咨询,精益生产管理,5S,6S现场管理培训_华谋咨询公司 | 卓能JOINTLEAN端子连接器厂家-专业提供PCB接线端子|轨道式端子|重载连接器|欧式连接器等电气连接产品和服务 | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | 电子厂招聘_工厂招聘_普工招聘_小时工招聘信息平台-众立方招工网 | 购买舔盐、舔砖、矿物质盐压块机,鱼饵、鱼饲料压块机--请到杜甫机械 | 免联考国际MBA_在职MBA报考条件/科目/排名-MBA信息网 | 杭州ROHS检测仪-XRF测试仪价格-百科 | 台式低速离心机-脱泡离心机-菌种摇床-常州市万丰仪器制造有限公司 | 江苏远邦专注皮带秤,高精度皮带秤,电子皮带秤研发生产 | hdpe土工膜-防渗膜-复合土工膜-长丝土工布价格-厂家直销「恒阳新材料」-山东恒阳新材料有限公司 ETFE膜结构_PTFE膜结构_空间钢结构_膜结构_张拉膜_浙江萬豪空间结构集团有限公司 | 冷却塔风机厂家_静音冷却塔风机_冷却塔电机维修更换维修-广东特菱节能空调设备有限公司 | 米顿罗计量泵(科普)——韬铭机械|