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

<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="qwawimqqmiuu" id='EiOIy'><tfoot id='EiOIy'></tfoot><dl id='EiOIy'><fieldset id='EiOIy'></fieldset></dl></div>

        來自表視圖控制器的多個(gè) segue

        Multiple segues from table view controller(來自表視圖控制器的多個(gè) 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="qwawimqqmiuu" 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>

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

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我有一個(gè)小應(yīng)用程序,它對(duì)初始表格視圖使用多個(gè)部分布局.一個(gè)部分顯示 Twitter 的最新趨勢,另一部分顯示 Twitter 的最新故事.當(dāng)我點(diǎn)擊趨勢列表中的一個(gè)項(xiàng)目時(shí),我會(huì)轉(zhuǎn)換到一個(gè)新的表格視圖控制器,該控制器顯示有關(guān)該趨勢的最新推文.在故事部分的根控制器中,我希望能夠在包含圖像、鏈接等的不同視圖控制器中顯示更多信息.問題是,當(dāng)我在故事部分中選擇任何內(nèi)容時(shí),我會(huì)被推送到為趨勢部分設(shè)置的表格視圖控制器.我已經(jīng)為每個(gè) segue 命名并為我想要轉(zhuǎn)換到的兩個(gè)視圖都有自定義類,我這樣做是為了檢查正在調(diào)用哪個(gè) 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];
                      }
                  }
                  

                  關(guān)于如何獲得不同觀點(diǎn)的任何建議?

                  Any suggestions on how to get to the different views?

                  推薦答案

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

                  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.

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

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

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

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

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

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

                  1. 使用多個(gè)原型表單元格——然后每個(gè)單元格都可以有自己的傳出自動(dòng)轉(zhuǎn)場.您需要更改表格視圖控制器的 tableView:cellForRowAtIndexPath: 以檢查索引路徑的節(jié)號(hào)并為 dequeueReusableCellWithIdentifier: 選擇適當(dāng)?shù)臉?biāo)識(shí)符,但這可能會(huì)使事情變得更多如果您的趨勢和故事單元具有不同的內(nèi)容,則方便或高效.

                  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.

                  使用手動(dòng)轉(zhuǎn)場.然后你的表視圖控制器可以實(shí)現(xiàn) tableView:didSelectRowAtIndexPath: 來調(diào)用 performSegueWithIdentifier: 并根據(jù)索引路徑的部分選擇適當(dāng)?shù)臉?biāo)識(shí)符.

                  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: 實(shí)現(xiàn)看起來都很好.

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

                  這篇關(guān)于來自表視圖控制器的多個(gè) segue的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持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?(如何通過點(diǎn)擊動(dòng)畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報(bào))
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標(biāo)已經(jīng)包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進(jìn)度圖像(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="qwawimqqmiuu" 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>

                            主站蜘蛛池模板: 免费精品视频在线观看 | 亚洲国产一区二区三区在线观看 | 国产精品亚洲综合 | 草草草网站 | 99欧美精品 | 伊人伊人 | 欧美在线网站 | 久草在线在线精品观看 | 日韩在线精品视频 | 日韩电影免费在线观看中文字幕 | 91成人免费看 | 欧美午夜影院 | 国产真实精品久久二三区 | 国产一区视频在线 | 精品久久久久久久久久久 | 日韩成人影院 | 国产亚洲精品美女久久久久久久久久 | 久久久国产精品视频 | 日韩成人在线视频 | 日韩免费福利视频 | 欧美a在线| 日本精品999 | 国产精品视频999 | 九九九国产 | 韩国欧洲一级毛片 | 一二三区视频 | 亚洲综合大片69999 | 在线亚洲电影 | 精品国产一区二区国模嫣然 | 日韩免费视频一区二区 | 欧美日韩在线不卡 | 农村真人裸体丰满少妇毛片 | 久草成人网 | 国产99久久精品一区二区永久免费 | 国产伦精品一区二区三区照片91 | 一区二区三区视频在线观看 | 亚洲久久一区 | www.色午夜.com | 在线视频一区二区 | 日本成人福利视频 | 中文字幕日韩欧美一区二区三区 |