Often I get an NSInternalInconsistencyException with different error messages, can any buddy give the particular reasons and the solutions about this exception. Please provide any information, links or blogs posts about this exception. It will help me and the newcomers to overcome this problem.
For example, I am getting the following exception messages:
"+entityForName: could not locate an NSManagedObjectModel for entity name 'Customer'"
2nd Context already has a coordinator; cannot replace.
NSInternalInconsistencyExceptionis a generic error, usually caused by a failedNSAssert,NSParameterAssertor other assertion. It’s usually accompanied by a specific error message that tells you where the problem is. Take the following code as an example:If
foois not ready to bar, this should cause an internal inconsistency exception saying so. Failed asserts like this are mostly seen during development (or at least they should be), because they often mean that the programmer is doing something wrong with the API, like violating some constraints that are not enforced through the type system.There’s nothing you can do with an internal inconsistency exception without knowing more, that would be like treating pain without looking for its cause.