2015-04-22 61 views
1

我試圖用方法deleteInBackgroundWithBlock從Parse中刪除記錄。我得到true在該塊中的succeeded參數。但是,該記錄仍然存在於解析面板上。解析iOS - 刪除方法返回true,但記錄不會被刪除

這裏是我的代碼:

let follow = ["objectId": "XXXXXXX"] 

let rawFollow: PFObject = PFObject(
     className: "Follow", 
     dictionary: follow) 

rawFollow.deleteInBackgroundWithBlock { (succeeded: Bool, error: NSError?) -> Void in 

    // succeeded = true, but record was not deleted.... 
} 
+0

同步嘗試時發生了什麼(即' - (BOOL)delete:(NSError **)error')?? –

回答

0

你不應該使用objectWithClassName:dictionary:,你應該使用objectWithoutDataWithClassName:objectId:。很可能你正在做的是用一個自定義的數據列創建一個新的對象,然後在它被保存/上傳之前刪除它。使用其他方法是爲已知對象ID創建佔位符而不必查詢對象的適當方式。

+0

謝謝!,你從很多頭髮中拯救了我 – OscarVGG