Skip to content

Nil pointer Exception if target contains a space #36

@PGLongo

Description

@PGLongo

If the target as a name with space like "Super Record" iOS replace the space with an "_" so the correct name for the model become "Super_Record.momd"

I have solved temporarily changing:

let infoDictionary = NSBundle.mainBundle().infoDictionary as NSDictionary?
let stackName = (infoDictionary!["CFBundleName"] as! String)
let storeName = stackName + ".sqlite"

with

let infoDictionary = NSBundle.mainBundle().infoDictionary as NSDictionary?
let stackName = (infoDictionary!["CFBundleName"] as! String).stringByReplacingOccurrencesOfString(" ", withString: "_")
let storeName = stackName + ".sqlite"

@michaelarmstrong you should considering it if you are writing the new stack.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions