Мой TapCell1.swift
Это пользовательский UITableViewCell View
import UIKit
class TapCell1: UITableViewCell
{
@IBOutlet var labelText : UILabel
init(style: UITableViewCellStyle, reuseIdentifier: String!)
{
println("Ente")
super.init(style: UITableViewCellStyle.Value1, reuseIdentifier: reuseIdentifier)
}
override func setSelected(selected: Bool, animated: Bool)
{
super.setSelected(selected, animated: animated)
}
}
Мой ViewController.swift
Все его данные и делегаты установлены правильно. Но моя пользовательская ячейка не отображается.
import UIKit
class NextViewController: UIViewController, UITableViewDelegate, UITableViewDataSource
{
@IBOutlet var label: UILabel
@IBOutlet var tableView : UITableView
var getvalue = NSString()
override func viewDidLoad()
{
super.viewDidLoad()
label.text="HELLO GOLD"
println("hello : \(getvalue)")
self.tableView.registerClass(TapCell1.self, forCellReuseIdentifier: "Cell")
}
func tableView(tableView:UITableView!, numberOfRowsInSection section:Int)->Int
{
return 5
}
func numberOfSectionsInTableView(tableView:UITableView!)->Int
{
return 1
}
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!
{
var cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as TapCell1
cell.labelText.text="Cell Text"
return cell
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Проблема: моя пользовательская ячейка не отображается. Пожалуйста, предложите все, что я сделал неправильно.
Примечание: вот мой код Ссылка на мой файл загрузки