简体   繁体   中英

Typhoon Injection - Crashing when injecting parameters using initializer

I am following Typhoon Coredata example ( https://github.com/appsquickly/Typhoon-CoreData-RAC-Example ) to configure coredata in swift.

But i am getting exception in the following method

public dynamic func managedObjectModel() -> AnyObject {
        return TyphoonDefinition.withClass(NSManagedObjectModel.self){
            (definition) in
            definition.useInitializer("contentsOfURL:"){
                (initializer) in
                 initializer.injectParameterWith(self.modelUrl())
            }
        }
    }

In the above function, i am trying to inject modelurl to "contentsOfURL" method of NSManagedObjectModel class. But i am getting following error

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Method 'contentsOfURL:' not found on 'NSManagedObjectModel'. Did you include the required ':' characters to signify arguments?'

//

//NSManagedObjectModel class  
    public convenience init?(contentsOfURL url: NSURL)
definition.useInitializer("initWithContentsOfURL:")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM