2015-05-01 24 views
5

Kodum:Xcode 6.3 Ayrıştırma SDK 1.7.1 PFTableViewCell hata "uyumsuz türüne sahip"

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 

}

Bütün uyumluluk bakmis

overriding method with selector 'tableView:cellForRowAtIndexPath:object:' has incompatible type '(UITableView,NSIndexPath,PFObject) -> PFTableViewCell' 

aşağıdaki hatayı alır hatalar (kaldırılıyor!).

Parse SDK 1.7.1 not working in Xcode 6.3

Ama sadece sayıları 3 hatası: Başka sonrası benzer bir sorunu vardı. Bu gönderideki diğer tüm sorunlar ele alındı, ancak bu hata devam ediyor. Nereye bakacağınız konusunda herhangi bir çözüm veya tavsiye var mı?

+0

Aynı sorunu yaşıyorum. Hiç anladın mı? –

+0

Ayrıştırma 1.7.2 kullanılabilir, ancak bu sorunu gidermiyor. –

cevap

4

Bunu çözdüm.

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

fark PFObject ve PFTableViewCell isteğe bağlı öğeleri yapıyor: Aşağıdaki override işlevini kullanın.

+0

Teşekkürler Clifton! İşleri de bulmuş olduğum şey: nesneler = nesneler olarak izin veriliyorsa func tableView (tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> PFTableViewCell { [PFObject] { nesnelerdeki nesne için {... – Rob

İlgili konular