Tarvo Mäesepp Tarvo Mäesepp - 1 month ago 76
Swift Question

Deleting file from Firebase storage causes crash

I tried to delete user's account but before deleting account I try to delete data that belongs to user. It does it, however after deleting all the data and user the app crashes and I can't see the problem.

I tried the "Zombie" to see why I get error and I tried breakpoint and only thing I could find is this:


2016-10-22 15:31:53.080008 App[7521:1721097] [Common] _BSMachError:
port 69d3; (os/kern) invalid capability (0x14) "Unable to insert
COPY_SEND"

_BSMachError: port 69d3; (os/kern) invalid name (0xf) "Unable to deallocate send right"2016-10-22 15:31:53.083114 App[7521:1721097] [Common]


All my breakpoints passed!

This is the code part that crashes the appp:

FIRStorage.storage().reference().child("users/\(self.currentUser.generalDetails.uid)").delete()

Answer

If you are using Swift 3 i dont think there is any function delete() in FIRStorage class , Try :-

FIRStorage.storage().reference().child("users/\(self.currentUser.generalDetails.uid)").delete(completion: {(err) in

    print(err?.localizedDescription)
    })

For Swift 2

FIRStorage.storage().reference().child("users/\(self.currentUser.generalDetails.uid)").deleteWithCompletion({(err) in

    print(err?.localizedDescription)
    })
Comments