Added a delete method which takes a pointer to an NSError object.