我正在尝试为我的应用设置一个关注/关注系统。我已经设置了装饰并显示出来。我的问题是,即使我知道它应该是假的,它仍然显示为真。我已经尝试了各种if语句,我似乎无法使用正确的变量或常量来运行检查,以便数组将返回true或false。该数组是以这种方式初始化的[false]。
self.backendless.persistenceService.of(BackendlessUser.ofClass()).find( query, response: { ( objectId : BackendlessCollection!) -> () in
let currentPage = objectId.getCurrentPage()
for objects in currentPage as! [BackendlessUser] {
if (objects.objectId != self.backendless.userService.currentUser.objectId) {
self.userids.append(objects.objectId)
self.backendless.persistenceService.of(objects.ofClass()).find( query, response: { objects -> () in
if let objects = objects {
self.isFollowing.append(true)
} else {
self.isFollowing.append(false)
}
if self.isFollowing.count == self.usernames.count{
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.tableView.reloadData()
})
}
}, error: { ( fault : Fault!) -> () in
print("Server reported an error: \(fault)")
}
)
}
}
})