Mã của tôi:Xcode 6.3 Parse SDK 1.7.1 PFTableViewCell Lỗi "có kiểu không tương thích"
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject) -> PFTableViewCell{
var cell = tableView.dequeueReusableCellWithIdentifier("CustomCell") as!
CustomTableViewCell!
if cell == nil {
cell = CustomTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "CustomCell")
}
// Extract values from the PFObject to display in the table cell
if let username = object["username"] as? String {
cell.customUser.text = username
}
if let title = object["Title"] as? String {
cell.customTitle.text = title
}
// Display image
var initialThumbnail = UIImage(named: "Swarm_Bee.png")
if let thumbnail = object["imageFile"] as? PFFile {
thumbnail.getDataInBackgroundWithBlock{
(imageData, error) -> Void in
if error == nil {
let image = UIImage(data: imageData!)
cell.customImage.image = image
}}
}
return cell
}
nhận được lỗi sau
overriding method with selector 'tableView:cellForRowAtIndexPath:object:' has incompatible type '(UITableView,NSIndexPath,PFObject) -> PFTableViewCell'
tôi đã xem xét tất cả các khả năng tương thích lỗi (loại bỏ!). bài khác đã có một vấn đề tương tự:
Parse SDK 1.7.1 not working in Xcode 6.3
Nhưng chỉ lỗi số 3 của họ. Tất cả các vấn đề khác trong bài viết đó đã được giải quyết, nhưng lỗi này vẫn còn. Bất kỳ giải pháp hoặc đề xuất về nơi để tìm?
Tôi gặp vấn đề tương tự. Bạn đã bao giờ tìm ra nó chưa? –
Phân tích cú pháp 1.7.2 có sẵn nhưng không khắc phục được sự cố này. –