I am getting the error "terminating with uncaught exception of type NSException." This question has a lot of views, but it does not solve my problem: libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) I have been able to track down the location of my error to this function:
func likeToLikeForAll(movieID: Int) {
let uid = Auth.auth().currentUser?.uid
Api.Like.REF_LIKES.child(uid!).child("100000").setValue(true)
Api.Like.REF_LIKES.child(uid!).observeSingleEvent(of: .value, with: { (snapshot) in
if let dictionary = snapshot.value as? [String: AnyObject] {
let array = Array(dictionary.keys)
for i in array {
let iInt = Int(i)!
if iInt != 100000 {
if movieID > iInt {
let movieIDString = String(movieID)
print("Bigger")
let nameOfLikeToLike = i + "." + movieIDString + "LL"
Api.LikeToLike.REF_LIKETOLIKE.child(nameOfLikeToLike).setValue(1)
}
else if movieID < iInt {
print("Smaller")
}
else if movieID == iInt {
print("Equal")
}
}
else {
print("Extra")
}
}
}
})
}
Does anybody know how to resolve this error?