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

  • <small id='H2HzF'></small><noframes id='H2HzF'>

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

        • <bdo id='H2HzF'></bdo><ul id='H2HzF'></ul>
        <i id='H2HzF'><tr id='H2HzF'><dt id='H2HzF'><q id='H2HzF'><span id='H2HzF'><b id='H2HzF'><form id='H2HzF'><ins id='H2HzF'></ins><ul id='H2HzF'></ul><sub id='H2HzF'></sub></form><legend id='H2HzF'></legend><bdo id='H2HzF'><pre id='H2HzF'><center id='H2HzF'></center></pre></bdo></b><th id='H2HzF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='H2HzF'><tfoot id='H2HzF'></tfoot><dl id='H2HzF'><fieldset id='H2HzF'></fieldset></dl></div>
      1. 覆蓋 initWithCoder 時(shí)的無(wú)限循環(huán)

        Infinite loop when overriding initWithCoder(覆蓋 initWithCoder 時(shí)的無(wú)限循環(huán))
        • <i id='J6bED'><tr id='J6bED'><dt id='J6bED'><q id='J6bED'><span id='J6bED'><b id='J6bED'><form id='J6bED'><ins id='J6bED'></ins><ul id='J6bED'></ul><sub id='J6bED'></sub></form><legend id='J6bED'></legend><bdo id='J6bED'><pre id='J6bED'><center id='J6bED'></center></pre></bdo></b><th id='J6bED'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='J6bED'><tfoot id='J6bED'></tfoot><dl id='J6bED'><fieldset id='J6bED'></fieldset></dl></div>
          1. <legend id='J6bED'><style id='J6bED'><dir id='J6bED'><q id='J6bED'></q></dir></style></legend>

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

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

                <tbody id='J6bED'></tbody>

                  <tfoot id='J6bED'></tfoot>

                1. 本文介紹了覆蓋 initWithCoder 時(shí)的無(wú)限循環(huán)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

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

                  我有一個(gè)帶有一些控制器和一些視圖的 UIViewController.其中兩個(gè)視圖(網(wǎng)格單元)是其他 nib.我有從網(wǎng)格單元到文件所有者的出口,但它們不會(huì)自動(dòng)加載.

                  I have a UIViewController with some controllers and some views. Two of these views (Grid Cell) are other nibs. I've got outlets from the Grid Cells to File's Owner, but they aren't loaded automatically.

                  所以我嘗試覆蓋 GridCell.minitWithCoder.這將啟動(dòng)一個(gè)無(wú)限循環(huán).

                  So I try to override GridCell.m's initWithCoder. This starts an infinite loop.

                  我知道可以重寫(xiě) initWithFrame 并從代碼中添加子視圖,但這不是我想要的.我希望能夠在 Interface Builder 中移動(dòng)視圖并讓 Xcode 使用正確的框架初始化視圖.

                  I know it's possible to just override initWithFrame and add the subview from code, but this is not what I want. I want to be able to move the view around in Interface Builder and have Xcode initialize the view with the right frame.

                  我該如何實(shí)現(xiàn)這一目標(biāo)?

                  How do I go about achieving this?

                  編輯 1

                  我正試圖在 Alexander 的幫助下讓它工作.這就是我現(xiàn)在設(shè)置它的方式:MainView 具有 UIView,其自定義類設(shè)置為 GridCell.它在 MainView/File's Owner 中有一個(gè)出口.

                  I'm trying to get it working with the help of Alexander. This is how I've now got it set up: MainView has UIView with a Custom class set as GridCell. It got an outlet in the MainView/File's Owner.

                  從 GridCell.m 中刪除所有初始化代碼并為我的自定義類設(shè)置一個(gè)出口

                  Removed all init-code from GridCell.m and set up an outlet to my custom class

                  雖然 MainView 仍然不顯示 GridCell.沒(méi)有錯(cuò)誤,只是一個(gè)孤獨(dú)的、空白的地方,紅色開(kāi)關(guān)應(yīng)該在的地方.我做錯(cuò)了什么?

                  The MainView don't still display the GridCell though. There's no error, just a lonely, empty space where the red switch should be. What am I doing wrong?

                  我非常接近以編程方式執(zhí)行此操作.不過(guò),我很想學(xué)習(xí)如何用筆尖做到這一點(diǎn).

                  I'm very close to just doing this programmatically. I would love to learn how to this with nibs though.

                  推薦答案

                  加載 nib 會(huì)導(dǎo)致 initWithCoder 再次被調(diào)用,所以你只想在子類當(dāng)前沒(méi)有任何子視圖的情況下這樣做.

                  Loading the nib causes initWithCoder to be called again, so you only want to do so if the subclass currently doesn't have any subviews.

                  -(id)initWithCoder:(NSCoder *)aDecoder {
                      self = [super initWithCoder:aDecoder];
                      if (self) {
                          if (self.subviews.count == 0) {
                              UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil];
                              UIView *subview = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0];
                              subview.frame = self.bounds;
                              [self addSubview:subview];
                          }
                      }
                      return self;
                  }
                  

                  這篇關(guān)于覆蓋 initWithCoder 時(shí)的無(wú)限循環(huán)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過(guò)點(diǎn)擊動(dòng)畫(huà) 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 屬性))
                    • <tfoot id='d7uSx'></tfoot>
                      • <small id='d7uSx'></small><noframes id='d7uSx'>

                            <bdo id='d7uSx'></bdo><ul id='d7uSx'></ul>
                            <i id='d7uSx'><tr id='d7uSx'><dt id='d7uSx'><q id='d7uSx'><span id='d7uSx'><b id='d7uSx'><form id='d7uSx'><ins id='d7uSx'></ins><ul id='d7uSx'></ul><sub id='d7uSx'></sub></form><legend id='d7uSx'></legend><bdo id='d7uSx'><pre id='d7uSx'><center id='d7uSx'></center></pre></bdo></b><th id='d7uSx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='d7uSx'><tfoot id='d7uSx'></tfoot><dl id='d7uSx'><fieldset id='d7uSx'></fieldset></dl></div>
                            <legend id='d7uSx'><style id='d7uSx'><dir id='d7uSx'><q id='d7uSx'></q></dir></style></legend>
                              <tbody id='d7uSx'></tbody>
                          • 主站蜘蛛池模板: 国产精品一区二区久久 | 91在线看 | 欧美成人h版在线观看 | 久久久久国产 | 国产不卡一区 | 国产区在线视频 | 亚洲精品一区二区三区在线观看 | 欧美日韩久久久 | 一区欧美| 日韩免费视频一区二区 | 国产精品久久久乱弄 | 国产精品久久久99 | 亚洲欧洲一区 | 天天综合网天天综合 | 久操亚洲 | 国产一区久久久 | 在线免费看毛片 | 在线观看av免费 | www.xxxx欧美 | 久久精品99久久 | 色眯眯视频在线观看 | 久久99这里只有精品 | 91精品久久久久久久久中文字幕 | 日韩一二区在线观看 | 2023亚洲天堂| 欧美中文视频 | 免费在线a视频 | 国产精品一区二区av | 日韩中字幕 | 中文字幕不卡一区 | 日日操夜夜操天天操 | 久久久一区二区 | 欧美 日韩 国产 成人 在线 91 | 天堂一区二区三区四区 | 天天操天天干天天爽 | 高清国产午夜精品久久久久久 | 国产女人与拘做视频免费 | 久久精品小视频 | 国产在线精品一区二区三区 | a级网站 | 亚洲欧美成人 |