Thousands of UITableViewCellSeperatorView in UITableView with custom cell

Since I am using xCode 6 beta 5 UITableViews

with nib files for custom cells, only a small bar of the cell is shown on the left and the rest is gray. When I open the View Debugger it says TableView

there are thousands in mine _UITableViewCellSeperatorViews

. Here is the classTableViewController

override func viewDidLoad() {
    super.viewDidLoad()

    let nib = UINib(nibName: "TestTableViewCell", bundle: nil)
    tableView.registerNib(nib, forCellReuseIdentifier: "newTestCell")
}

override func numberOfSectionsInTableView(tableView: UITableView!) -> Int {
    return 1
}

override func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
    return 1
}

override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
    let cell = tableView.dequeueReusableCellWithIdentifier("newTestCell", forIndexPath: indexPath) as TestTableViewCell
    cell.loadData("Test")
    return cell
}

      

Here is the cell class:

@IBOutlet weak var someLabel: UILabel!

func loadData(text: String) {
    someLabel.text = text
}

      

Now I have a TableView image in the View Debugger:

TableView in Debugger

+3


source to share


1 answer


This is really puzzling. This is how I fixed it: right after registering nib add



tableView.rowHeight = 44 // or whatever

      

+1


source







All Articles