[英]Typhoon Injection - Crashing when injecting parameters using initializer
我正在遵循Typhoon Coredata示例( https://github.com/appsquickly/Typhoon-CoreData-RAC-Example )快速配置coredata。
但是我在以下方法中遇到異常
public dynamic func managedObjectModel() -> AnyObject {
return TyphoonDefinition.withClass(NSManagedObjectModel.self){
(definition) in
definition.useInitializer("contentsOfURL:"){
(initializer) in
initializer.injectParameterWith(self.modelUrl())
}
}
}
在上面的函數中,我試圖將modelurl注入NSManagedObjectModel類的“ contentsOfURL”方法。 但我得到以下錯誤
*** 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:")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.