Alecrim/AlecrimCoreData

InvalidManagedObjectModelURL thrown for Project names with character "-"

Closed this issue · 0 comments

v 4.1.1
DataContextOptions.swift

inferredManagedObjectModelName extension property needs to be updated to replace all invalid characters and not just space " ". Project names can contain other characters such as "-". So need to add this to characters for replacement.

e.g. MyApp-Objc, MyApp-Swift, etc

Temp sol'n:

//Make this pretty and use a replaceall extension private var inferredManagedObjectModelName: String? { return (self.infoDictionary?[String(kCFBundleNameKey)] as? String)?.stringByReplacingOccurrencesOfString(" ", withString: "_").stringByReplacingOccurrencesOfString("-", withString: "_") }