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

  1. <legend id='sMqQR'><style id='sMqQR'><dir id='sMqQR'><q id='sMqQR'></q></dir></style></legend>

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

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

      <tfoot id='sMqQR'></tfoot>
      • <bdo id='sMqQR'></bdo><ul id='sMqQR'></ul>

      如何在 iOS 5 故事板中初始化自定義原型樣式表單

      How to initialize a custom prototype style table cell in iOS 5 storyboards?(如何在 iOS 5 故事板中初始化自定義原型樣式表單元格?)

        <tfoot id='5ZHSk'></tfoot>

          <tbody id='5ZHSk'></tbody>

        <small id='5ZHSk'></small><noframes id='5ZHSk'>

        • <bdo id='5ZHSk'></bdo><ul id='5ZHSk'></ul>

            1. <i id='5ZHSk'><tr id='5ZHSk'><dt id='5ZHSk'><q id='5ZHSk'><span id='5ZHSk'><b id='5ZHSk'><form id='5ZHSk'><ins id='5ZHSk'></ins><ul id='5ZHSk'></ul><sub id='5ZHSk'></sub></form><legend id='5ZHSk'></legend><bdo id='5ZHSk'><pre id='5ZHSk'><center id='5ZHSk'></center></pre></bdo></b><th id='5ZHSk'></th></span></q></dt></tr></i><div class="557rpll" id='5ZHSk'><tfoot id='5ZHSk'></tfoot><dl id='5ZHSk'><fieldset id='5ZHSk'></fieldset></dl></div>
              • <legend id='5ZHSk'><style id='5ZHSk'><dir id='5ZHSk'><q id='5ZHSk'></q></dir></style></legend>
                本文介紹了如何在 iOS 5 故事板中初始化自定義原型樣式表單元格?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在轉換到 iOS 5 和情節提要.當我有一個具有默認單元格樣式的表格視圖時,一切正常.

                I am converting over to iOS 5 and storyboards. When I have a table view with default cell style, everything works fine.

                - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
                    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifierFromStoryboard"];
                    if (cell == nil) {
                        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyIdentifierFromStoryboard"];
                    }
                    return cell;
                }
                

                我已經看到了刪除if (cell == nil)"塊的示例.但是,如果我將其取出,我的應用程序會崩潰并顯示以下消息:UITableView 數據源必須從 tableView:cellForRowAtIndexPath: 返回一個單元格:".這不是問題,因為它的工作原理如上所示.

                I have seen examples where the "if (cell == nil)" block is removed. However if I take it out, my app crashes with the message: "UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:". This is not a problem because it works as shown above.

                我的問題是我想為單元格使用自定義樣式,因此無法使用 initWithStyle.如何初始化我在情節提要上設計的自定義單元格?

                My problem is that I want to use a custom style for the cell and thus cannot use initWithStyle. How do I initialize a custom cell that I have designed on the storyboard?

                舊的 pre-5 應用有一個 nib 和 class 使用類似的東西,但現在我使用的是故事板.

                The old pre-5 app had a nib and class that used something like this, but now I'm using the storyboard.

                - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
                    MyCustomTableCell *cell = (MyCustomTableCell *) [tableView dequeueReusableCellWithIdentifier:@"MyCustomIdentifier"];
                    if (cell == nil) {
                        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyCustomTableCell" owner:self options:nil];
                        cell = (MyCustomTableCell *) [nib objectAtIndex:0];
                    }
                    return cell;
                }
                

                推薦答案

                這樣

                - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
                    static NSString *CellIdentifier = @"Cell";
                    CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
                    if (cell == nil) {
                        cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
                    }
                
                    return cell;
                }
                

                這篇關于如何在 iOS 5 故事板中初始化自定義原型樣式表單元格?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 屬性))
                    <tbody id='io6UB'></tbody>
                    <bdo id='io6UB'></bdo><ul id='io6UB'></ul>
                    <legend id='io6UB'><style id='io6UB'><dir id='io6UB'><q id='io6UB'></q></dir></style></legend>
                    1. <tfoot id='io6UB'></tfoot>

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

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

                          主站蜘蛛池模板: 中国在职研究生招生信息网 | 布袋除尘器|除尘器设备|除尘布袋|除尘设备_诺和环保设备 | 耙式干燥机_真空耙式干燥机厂家-无锡鹏茂化工装备有限公司 | X光检测仪_食品金属异物检测机_X射线检测设备_微现检测 | 花纹铝板,合金铝卷板,阴极铝板-济南恒诚铝业有限公司 | 北京易通慧公司从事北京网站优化,北京网络推广、网站建设一站式服务商-北京网站优化公司 | 电动葫芦|防爆钢丝绳电动葫芦|手拉葫芦-保定大力起重葫芦有限公司 | 山东led显示屏,山东led全彩显示屏,山东LED小间距屏,临沂全彩电子屏-山东亚泰视讯传媒有限公司 | MVE振动电机_MVE震动电机_MVE卧式振打电机-河南新乡德诚生产厂家 | 欧必特空气能-商用空气能热水工程,空气能热水器,超低温空气源热泵生产厂家-湖南欧必特空气能公司 | 烟气换热器_GGH烟气换热器_空气预热器_高温气气换热器-青岛康景辉 | 半容积式换热器_北京浮动盘管换热器厂家|北京亿丰上达 | 泰国试管婴儿_泰国第三代试管婴儿_泰国试管婴儿费用/多少钱_孕泰来 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 专业的压球机生产线及解决方案厂家-河南腾达机械厂 | 层流手术室净化装修-检验科ICU改造施工-华锐净化工程-特殊科室建设厂家 | 南京租车,南京汽车租赁,南京包车,南京会议租车-南京七熹租车 | 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 渣土车电机,太阳能跟踪器电机,蜗轮蜗杆减速电机厂家-淄博传强电机 | 北京中创汇安科贸有限公司 | 上海深蓝_缠绕机_缠膜机-上海深蓝机械装备有限公司 | 上海乾拓贸易有限公司-日本SMC电磁阀_德国FESTO电磁阀_德国FESTO气缸 | 代理记账_免费注册公司_营业执照代办_资质代办-【乐财汇】 | 存包柜厂家_电子存包柜_超市存包柜_超市电子存包柜_自动存包柜-洛阳中星 | 安驭邦官网-双向万能直角铣头,加工中心侧铣头,角度头[厂家直销] 闸阀_截止阀_止回阀「生产厂家」-上海卡比阀门有限公司 | 双杰天平-国产双杰电子天平-美国双杰-常熟双杰仪器 | 科昊仪器超纯水机系统-可成气相液氮罐-美菱超低温冰箱-西安昊兴生物科技有限公司 | 海峰资讯 - 专注装饰公司营销型网站建设和网络营销培训 | 预制舱-电力集装箱预制舱-模块化预制舱生产厂家-腾达电器设备 | 天津仓库出租网-天津电商仓库-天津云仓一件代发-【博程云仓】 | 物流公司电话|附近物流公司电话上门取货 | pos机办理,智能/扫码/二维码/微信支付宝pos机-北京万汇通宝商贸有限公司 | 阴离子聚丙烯酰胺价格_PAM_高分子聚丙烯酰胺厂家-河南泰航净水材料有限公司 | 天津中都白癜风医院_天津白癜风医院_天津治疗白癜风 | 红酒招商加盟-葡萄酒加盟-进口红酒代理-青岛枞木酒业有限公司 | 济南玻璃安装_济南玻璃门_济南感应门_济南玻璃隔断_济南玻璃门维修_济南镜片安装_济南肯德基门_济南高隔间-济南凯轩鹏宇玻璃有限公司 | 上海律师咨询_上海法律在线咨询免费_找对口律师上策法网-策法网 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 临海涌泉蜜桔官网|涌泉蜜桔微商批发代理|涌泉蜜桔供应链|涌泉蜜桔一件代发 | 苏州伊诺尔拆除公司_专业酒店厂房拆除_商场学校拆除_办公楼房屋拆除_家工装拆除拆旧 | 广州小程序开发_APP开发公司_分销商城系统定制_小跑科技 | 电销卡_稳定企业大语音卡-归属地可选-世纪通信 |