i've sample app using parse.com end , i'm writing unit tests. said in parse documentation, when subclassed pfobject implemented initialize method:
override class func initialize() { struct static { static var oncetoken : dispatch_once_t = 0; } dispatch_once(&static.oncetoken) { self.registersubclass() } } when run unit tests app crashes in initialize method following error:
terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'tried register both targetname.myobject , targetnametests.myobject native pfobject subclass of myobject. cannot determine right class use because neither inherits other.
any idea how solve issue?
the way have found way make work not include subclass in test target , declare subclass , variables , methods public. , import application target
#import myproject #import parse #import xctest public class mysubclass: pfobject, pfsubclassing { @nsmanaged public var name: string? public static func parseclassname() -> string { return "mysubclass" } } then in test file need call class such:
let testobject = myproject.myclass()
Comments
Post a Comment