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

    <legend id='Q1tk0'><style id='Q1tk0'><dir id='Q1tk0'><q id='Q1tk0'></q></dir></style></legend>

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

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

      在 Swift 中以编程方式设置 uitableview 的委托和数据源

      set delegate and datasource of uitableview programmatically in Swift(在 Swift 中以编程方式设置 uitableview 的委托和数据源)
    1. <small id='hWrcY'></small><noframes id='hWrcY'>

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

      • <legend id='hWrcY'><style id='hWrcY'><dir id='hWrcY'><q id='hWrcY'></q></dir></style></legend>
            <tbody id='hWrcY'></tbody>
            • <tfoot id='hWrcY'></tfoot>

              1. 本文介绍了在 Swift 中以编程方式设置 uitableview 的委托和数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想为 'tableViewinViewController.swift` 文件设置 delegatedatasource.

                I would like to set the delegate and datasource for 'tableViewinViewController.swift` file.

                我在 viewDidLoad 函数中编写了这段代码,但它不起作用.

                I wrote this code in my viewDidLoad function, but it's not working.

                代码:

                    tableView.delegate?.self
                    tableView.dataSource?.self
                

                我正在使用 CoreData,我的实体名为Note".

                I'm working with CoreData and my Entity is named "Note".

                希望有人能帮我解决这个问题.

                Hope someone can help me to solve this problem.

                推荐答案

                设置委托和数据源的正确方法是:

                The correct way to set the delegate and data source is:

                tableView.delegate = self
                tableView.dataSource = self
                

                这篇关于在 Swift 中以编程方式设置 uitableview 的委托和数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)
                How to copy a quot;Dictionaryquot; in Swift?(如何复制“字典在斯威夫特?)
                Swift - How to mutate a struct object when iterating over it(Swift - 迭代结构对象时如何对其进行变异)
                How to copy text to clipboard/pasteboard with Swift(如何使用 Swift 将文本复制到剪贴板/粘贴板)
                Swift Cannot invoke #39;find#39; with an argument list of type #39;([Score], Score)#39; where Score is a struct(Swift 无法使用类型为“([Score],Score)的参数列表调用“find,其中 Score 是一个结构)
                objective - C : Loading image from URL?(目标 - C:从 URL 加载图像?)
                <i id='dt6eo'><tr id='dt6eo'><dt id='dt6eo'><q id='dt6eo'><span id='dt6eo'><b id='dt6eo'><form id='dt6eo'><ins id='dt6eo'></ins><ul id='dt6eo'></ul><sub id='dt6eo'></sub></form><legend id='dt6eo'></legend><bdo id='dt6eo'><pre id='dt6eo'><center id='dt6eo'></center></pre></bdo></b><th id='dt6eo'></th></span></q></dt></tr></i><div id='dt6eo'><tfoot id='dt6eo'></tfoot><dl id='dt6eo'><fieldset id='dt6eo'></fieldset></dl></div>
              2. <small id='dt6eo'></small><noframes id='dt6eo'>

              3. <legend id='dt6eo'><style id='dt6eo'><dir id='dt6eo'><q id='dt6eo'></q></dir></style></legend>

                  <tfoot id='dt6eo'></tfoot>
                        <tbody id='dt6eo'></tbody>
                        • <bdo id='dt6eo'></bdo><ul id='dt6eo'></ul>