samedi 27 juin 2015

Could not cast value MyApp.MyCustomClass to MyAppTests.MyCustomClass

This is an error:

Could not cast value of type DirectBistro.DBWorkingHours (0x7f8ce8741930) to DirectBistroTests.DBWorkingHours (0x119237120).

This is how I use it:

if let firstWorkingHours = location.settings.workingHours.first { //error
    XCTAssertEqual(firstWorkingHours.identifier, "1234", "")
    XCTAssertEqual(firstWorkingHours.daysBitmask, 6, "")
    XCTAssertEqual(firstWorkingHours.settings, location.settings, "")
    XCTAssertEqual(firstWorkingHours.close, 59400, "")
    XCTAssertEqual(firstWorkingHours.open, 32400, "")
}

And this is how I declare it inside settings:

@NSManaged var workingHours: Set<DBWorkingHours>

Aucun commentaire:

Enregistrer un commentaire