2016-01-25 5 views
2

Использования parse.com v1.4 (устанавливается с стручками какао) с Swift 2 +Невозможно отобразить пользовательскую ячейку с PFQueryTableViewController (Swift2)

я установка до моего PFQueryTableViewController (ParseUI) с пользовательской ячейкой. Я считаю, что все подключено отлично, однако я не могу заставить ячейку отображать значение с Parse.com, даже если я его получаю и могу распечатать (я отлаживал его).

Я освобождение пакета из очереди, как это:

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFTableViewCell { 

    let cellIdentifier = "Cell" 

    let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! OrderTableViewCell 

    // Extract values from the PFObject to display in the table cell 
    if let pfObject = object { 

     // prints expected value, e.g. 1, 2, 3 
     print(pfObject["table"]) 

     // shows "Label" which is my label's default text on the SB!! 
     let table = pfObject["table"] as? String 
     cell.lblTable.text = table 
    } 
    return cell 
} 

Остальная часть моего PFQueryTableViewController, который, кажется, чтобы загрузить данные OK от Parse: enter image description here

Моего заказа клетка OrderTableViewCell (с некоторым IBActions этикетки): enter image description here

SB установка:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

И результат:

enter image description here

Как я могу получить ярлык для отображения фактического текста? Что мне не хватает? Я не хочу возвращаться к стандартному UITableView из-за дополнительных возможностей, которые я получаю с интерфейсом Parse.

ответ

0

оказывается, что это было так просто, как изменение

let table = pfObject["table"] as? String 

в

let table = String(pfObject["table"]) 
Смежные вопросы