I've a sample app using Parse.com as back end and now I'm writing some unit tests. As said in the Parse documentation, when I subclassed PFObject I implemented the initialize method:
override class func initialize() {
struct Static {
static var onceToken : dispatch_once_t = 0;
}
dispatch_once(&Static.onceToken) {
self.registerSubclass()
}
}
When I run my unit tests my app crashes in the initialize method with the following error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to register both TargetName.MyObject and TargetNameTests.MyObject as the native PFObject subclass of MyObject. Cannot determine the right class to use because neither inherits from the other.
Any idea how to solve this issue?
Aucun commentaire:
Enregistrer un commentaire