'+entityForName: nil is not a legal NSPersistentStoreCoordinator for searching for entity name
问题 Getting the exception later in the program when _managedObjectModel is being used. Below is initialiser code. NSURL *modelURL = [[NSBundle mainBundle] URLForResource:self.managedObjectModelName withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; The problem is that _managedObjectModel is pointing to a garbage memory location. After analysing GPR and assembly code i found that the ManagedObjectModel was being initialised properly but,