Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios JTAppleCalendar单元格是否在TableView中?斯威夫特3_Ios_Uitableview_Swift3_Uicollectionview_Jtapplecalendar - Fatal编程技术网

Ios JTAppleCalendar单元格是否在TableView中?斯威夫特3

Ios JTAppleCalendar单元格是否在TableView中?斯威夫特3,ios,uitableview,swift3,uicollectionview,jtapplecalendar,Ios,Uitableview,Swift3,Uicollectionview,Jtapplecalendar,我正在使用JTAppleCalendar->日历插件,我想把collectionview单元格放在TableView单元格中,我想在那里显示添加了标题的事件(TableView单元格内)中的每个单元格,但当我连接outlets时,我得到的是 错误:非法配置:从ViewController到UITableView的tableView出口无效。无法将出口连接到重复内容 我怎样才能修好它 CellView.swift import JTAppleCalendar class CellView: JT

我正在使用
JTAppleCalendar
->日历插件,我想把collectionview单元格放在TableView单元格中,我想在那里显示添加了标题的事件(TableView单元格内)中的每个单元格,但当我连接outlets时,我得到的是

错误:非法配置:从ViewController到UITableView的tableView出口无效。无法将出口连接到重复内容

我怎样才能修好它

CellView.swift

import JTAppleCalendar

class CellView: JTAppleCell {
    @IBOutlet var selectedView: UIView!
    @IBOutlet var dayLabel: UILabel!
    @IBOutlet var Label: UILabel!
}
牢房,斯威夫特

import UIKit

class Cell: UITableViewCell {

    @IBOutlet weak var label : UILabel!

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)


    }
}
视图控制器,斯威夫特

@IBOutlet weak var tableView: UITableView!


  extension ViewController: UITableViewDelegate, UITableViewDataSource {

        func numberOfSections(in tableView: UITableView) -> Int {
            return  1
        }

        func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
            return  5
        }

        func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
            let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! Cell

            cell.label?.text = String(indexPath.row)

            return cell
        }

        func tableView(_ tableView: UITableView,didSelectRowAt indexPath: IndexPath) {
            tableView.deselectRow(at: indexPath, animated: true)
        }
    }
我的屏幕在下面


您需要创建CollectionViewCell的自定义类,并在其上使用IBMOutlets。现在您已经在ViewController的类中获取了customCell的视图

使用标记属性可以将该视图链接到单元格。如下所示,在cellForItemAtIndexPath中

let label:UILabel = cell.viewWithTag(101) as! UILabel // 101 tag need to set in storyboard related view 
如何为视图分配标签


然后仍然出现了这个问题。我添加了我的tableview代码。您能告诉我如何修复它吗?声明的单元格标签在哪里?我添加了单元格。Swifti如果您创建一个新的github问题,并在那里上载一个小的问题zip文件,我可以提供帮助。然后我会回来把答案放在这里。