Tôi đang cố truy vấn tất cả người dùng hiện tại trong ứng dụng của mình mà người dùng chưa thêm làm "Bạn bè". Tôi nhận được lỗi'Không thể thực hiện truy vấn so sánh cho loại: PFRelation' Swift
Không thể làm một truy vấn so sánh cho loại hình: PFRelation
Dưới đây là mã hiện tại của tôi:
override func queryForTable() -> PFQuery {
let currentFriends : PFRelation = PFUser.currentUser()!.relationForKey("friends")
// Start the query object
let query = PFQuery(className: "_User")
query.whereKey("username", notEqualTo: currentFriends)
// Add a where clause if there is a search criteria
if UserInput.text != "" {
query.whereKey("username", containsString: UserInput.text)
}
// Order the results
query.orderByAscending("username")
// Return the qwuery object
return query
}
Làm thế nào để giải quyết vấn đề này? Cảm ơn