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

<legend id='EiOIy'><style id='EiOIy'><dir id='EiOIy'><q id='EiOIy'></q></dir></style></legend>
    <tfoot id='EiOIy'></tfoot>

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

      <bdo id='EiOIy'></bdo><ul id='EiOIy'></ul>

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

        來自表視圖控制器的多個 segue

        Multiple segues from table view controller(來自表視圖控制器的多個 segue)

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

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

                <tfoot id='CKtEM'></tfoot>
                  <bdo id='CKtEM'></bdo><ul id='CKtEM'></ul>

                • 本文介紹了來自表視圖控制器的多個 segue的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個小應用程序,它對初始表格視圖使用多個部分布局.一個部分顯示 Twitter 的最新趨勢,另一部分顯示 Twitter 的最新故事.當我點擊趨勢列表中的一個項目時,我會轉換到一個新的表格視圖控制器,該控制器顯示有關該趨勢的最新推文.在故事部分的根控制器中,我希望能夠在包含圖像、鏈接等的不同視圖控制器中顯示更多信息.問題是,當我在故事部分中選擇任何內容時,我會被推送到為趨勢部分設置的表格視圖控制器.我已經為每個 segue 命名并為我想要轉換到的兩個視圖都有自定義類,我這樣做是為了檢查正在調用哪個 segue:

                  I have a small app that uses multiple section layouts for the initial table view. One section displays the most recent trends from Twitter and the other section displays the most recent stories from Twitter. When I click on an item within the list of trends I transition to a new table view controller that displays the most recent tweets about that trend. Within the root controller for the stories section I wat to be able to display more information in a different view controller that contains images, links, and so forth. The problem is that when I select anything within the stories section, I am being pushed to the table view controller that is set up for the trends section. I have named each segue and have custom classes for both of the views that I want to transition to and I am doing this to check which segue is being called:

                  -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
                  
                      if([[segue identifier] isEqualToString:@"viewTrendsSearch"]) {
                  
                          //get the controller that we are going to segue to
                          SearchTrendResultsViewController *strvc = [segue destinationViewController];
                  
                          //get the path of the row that we want from the table view
                          NSIndexPath *path = [self.tableView indexPathForSelectedRow];
                  
                          //here we get the trend object from the array we set up earlier to hold all trends
                          Trends *results = [currentTrends objectAtIndex:[path row]];
                  
                          //pass the object that was selected in the table view to the destination view
                          [strvc setQuery: results];
                      }
                  
                      if([[segue identifier] isEqualToString:@"storyfullDetails"]) {
                  
                          StoriesViewController *svc = [segue destinationViewController];
                  
                          NSIndexPath *path = [self.tableView indexPathForSelectedRow];
                  
                          Stories *results = [currentStories objectAtIndex:[path row]];
                  
                          [svc setStory:results];
                      }
                  }
                  

                  關于如何獲得不同觀點的任何建議?

                  Any suggestions on how to get to the different views?

                  推薦答案

                  您的問題中沒有足夠的信息可以確定,但這聽起來像是一個問題,我稱之為自動與手動 segues 以及每個問題的限制.

                  There's not quite enough information in your question to be sure, but this sounds like an issue with what I'd call automatic versus manual segues and the restrictions on each.

                  自動轉場是在 IB 中通過從(原型)表格單元格或其他控件拖動來創建的.它的好處是它是自動的——點擊控件執行 segue,你需要在代碼中執行 prepareForSegue:sender: 以便目標視圖控制器獲取正確的數據.缺點是任何給定的控件(包括原型表單元格)只能有一個傳出 segue(否則,故事板將不知道要自動執行哪個).

                  An automatic segue is created in IB by dragging from a (prototype) table cell or other control. The nice thing about it is that it's, well, automatic -- tapping the control performs the segue, and all you need to do in your code is implement prepareForSegue:sender: so that the destination view controller gets the right data. The downside is that any given control (including prototype table cells) can only have one outgoing segue (otherwise, the storyboard wouldn't know which to automatically perform).

                  通過從源視圖控制器拖動,在 IB 中創建了一個 手動 segue.這樣做的好處是視圖控制器可以有多個傳出的segue.另一方面,它們與可點擊控件無關,因此您必須實現確定何時執行的邏輯(并調用 performSegueWithIdentifier: 來實現).

                  A manual segue is created in IB by dragging from the source view controller. The upside to this is that a view controller can have multiple outgoing segues. On the other hand, they aren't associated with a tappable control, so you have to implement logic that determines which to perform when (and calls performSegueWithIdentifier: to make it happen).

                  考慮到這些權衡,您的問題有兩種可能的解決方案:

                  Given those tradeoffs, there are two possible solutions to your problem:

                  1. 使用多個原型表單元格——然后每個單元格都可以有自己的傳出自動轉場.您需要更改表格視圖控制器的 tableView:cellForRowAtIndexPath: 以檢查索引路徑的節號并為 dequeueReusableCellWithIdentifier: 選擇適當的標識符,但這可能會使事情變得更多如果您的趨勢和故事單元具有不同的內容,則方便或高效.

                  1. Use multiple prototype table cells -- then each can have its own outgoing automatic segue. You'll need to change your table view controller's tableView:cellForRowAtIndexPath: to check the index path's section number and choose the appropriate identifier for dequeueReusableCellWithIdentifier:, but this might make things more convenient or efficient if your trend and story cells have different content anyway.

                  使用手動轉場.然后你的表視圖控制器可以實現 tableView:didSelectRowAtIndexPath: 來調用 performSegueWithIdentifier: 并根據索引路徑的部分選擇適當的標識符.

                  Use manual segues. Then your table view controller can implement tableView:didSelectRowAtIndexPath: to call performSegueWithIdentifier: with the appropriate identifier chosen based on the index path's section.

                  無論哪種方式,您的 prepareForSegue:sender: 實現看起來都很好.

                  Either way, your prepareForSegue:sender: implementation looks fine.

                  這篇關于來自表視圖控制器的多個 segue的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 屬性))
                  <i id='00ZWv'><tr id='00ZWv'><dt id='00ZWv'><q id='00ZWv'><span id='00ZWv'><b id='00ZWv'><form id='00ZWv'><ins id='00ZWv'></ins><ul id='00ZWv'></ul><sub id='00ZWv'></sub></form><legend id='00ZWv'></legend><bdo id='00ZWv'><pre id='00ZWv'><center id='00ZWv'></center></pre></bdo></b><th id='00ZWv'></th></span></q></dt></tr></i><div class="u02s2ym" id='00ZWv'><tfoot id='00ZWv'></tfoot><dl id='00ZWv'><fieldset id='00ZWv'></fieldset></dl></div>
                    <bdo id='00ZWv'></bdo><ul id='00ZWv'></ul>

                      <tfoot id='00ZWv'></tfoot>
                        <legend id='00ZWv'><style id='00ZWv'><dir id='00ZWv'><q id='00ZWv'></q></dir></style></legend>

                        <small id='00ZWv'></small><noframes id='00ZWv'>

                              <tbody id='00ZWv'></tbody>

                            主站蜘蛛池模板: 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 同学聚会纪念册制作_毕业相册制作-成都顺时针宣传画册设计公司 | 座椅式升降机_无障碍升降平台_残疾人升降平台-南京明顺机械设备有限公司 | 轴流风机-鼓风机-离心风机-散热风扇-罩极电机,生产厂家-首肯电子 | 蒸汽热收缩机_蒸汽发生器_塑封机_包膜机_封切收缩机_热收缩包装机_真空机_全自动打包机_捆扎机_封箱机-东莞市中堡智能科技有限公司 | 聚氨酯保温钢管_聚氨酯直埋保温管道_聚氨酯发泡保温管厂家-沧州万荣防腐保温管道有限公司 | 顺景erp系统_erp软件_erp软件系统_企业erp管理系统-广东顺景软件科技有限公司 | 作文导航网_作文之家_满分作文_优秀作文_作文大全_作文素材_最新作文分享发布平台 | 衬塑管道_衬四氟管道厂家-淄博恒固化工设备有限公司 | 哲力实业_专注汽车涂料汽车漆研发生产_汽车漆|修补油漆品牌厂家 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 | 刚性-柔性防水套管-橡胶伸缩接头-波纹管补偿器-启腾供水材料有限公司 | 执业药师报名条件,考试时间,考试真题,报名入口—首页 | 交通信号灯生产厂家_红绿灯厂家_电子警察监控杆_标志杆厂家-沃霖电子科技 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 强效碱性清洗剂-实验室中性清洗剂-食品级高纯氮气发生器-上海润榕科学器材有限公司 | 压片机_高速_单冲_双层_花篮式_多功能旋转压片机-上海天九压片机厂家 | 耐磨陶瓷,耐磨陶瓷管道_厂家-淄博拓创陶瓷科技 | 磁力反应釜,高压釜,实验室反应釜,高温高压反应釜-威海自控反应釜有限公司 | 讲师宝经纪-专业培训机构师资供应商_培训机构找讲师、培训师、讲师经纪就上讲师宝经纪 | 炭黑吸油计_测试仪,单颗粒子硬度仪_ASTM标准炭黑自销-上海贺纳斯仪器仪表有限公司(HITEC中国办事处) | 生鲜配送系统-蔬菜食材配送管理系统-连锁餐饮订货配送软件-挪挪生鲜供应链管理软件 | 广东成考网-广东成人高考网 | 玖容气动液压设备有限公司-气液增压缸_压力机_增压机_铆接机_增压器 | 洁净化验室净化工程_成都实验室装修设计施工_四川华锐净化公司 | 定制/定做冲锋衣厂家/公司-订做/订制冲锋衣价格/费用-北京圣达信 | 双杰天平-国产双杰电子天平-美国双杰-常熟双杰仪器 | 压力控制器,差压控制器,温度控制器,防爆压力控制器,防爆温度控制器,防爆差压控制器-常州天利智能控制股份有限公司 | 油冷式_微型_TDY电动滚筒_外装_外置式电动滚筒厂家-淄博秉泓机械有限公司 | 郑州大巴车出租|中巴车租赁|旅游大巴租车|包车|郑州旅游大巴车租赁有限公司 | 智能楼宇-楼宇自控系统-楼宇智能化-楼宇自动化-三水智能化 | 定时排水阀/排气阀-仪表三通旋塞阀-直角式脉冲电磁阀-永嘉良科阀门有限公司 | 底部填充胶_电子封装胶_芯片封装胶_芯片底部填充胶厂家-东莞汉思新材料 | 太空舱_民宿太空舱厂家_移动房屋太空舱价格-豪品建筑 | 天津蒸汽/热水锅炉-电锅炉安装维修直销厂家-天津鑫淼暖通设备有限公司 | 南昌旅行社_南昌国际旅行社_南昌国旅在线 | 仿古建筑设计-仿古建筑施工-仿古建筑公司-汉匠古建筑设计院 | 超声波气象站_防爆气象站_空气质量监测站_负氧离子检测仪-风途物联网 | 锤式粉碎机,医药粉碎机,锥式粉碎机-无锡市迪麦森机械制造有限公司 | 风信子发稿-专注为企业提供全球新闻稿发布服务 | 都江堰招聘网-都江堰人才网 都江堰人事人才网 都江堰人才招聘网 邢台人才网_邢台招聘网_邢台123招聘【智达人才网】 |