Core Data is warning me that I have no inverse relationship, which would make no sense to me and would seem to even be negative for performance. But the follow StackOverflow answer was a huge help in realizing that it actually makes sense to have an inverse relationship since Core Data uses it for data integrity!

Apple generally recommends that you always create and specify the inverse, even if you don’t use the inverse relationship in your app. For this reason, it warns you when you fail to provide an inverse.

Relationships are not required to have an inverse, because there are a few scenarios in which the inverse relationship could hurt performance. For example, suppose the inverse relationship contains an extremely large number of objects. Removing the inverse requires iterating over the set that represents the inverse, weakening performance.

But unless you have a specific reason not to, model the inverse. It helps Core Data ensure data integrity. If you run into performance issues, it’s relatively easy to remove the inverse relationship later.

The issue was that my NSManagedObjectContext itself was nil, it wasn’t anything internal in NSManagedObjectContext fetch, like it looked at first…

So then the question became why it was nil. Turns out I had included the xcdatamodeld file in one of my sub-modules instead of my main target. Because the model is being accessed at run-time, it wasn’t accessible from the main module.

Was trying to have a centered label in custom table view cells but have an accessory type for some. That caused the labels to be indented to the left because the accessory type makes the content view of the cell smaller. Here is the solution I ended up with (and posting to a Stackoverflow question where everyone else’s answer was for default table view cells only).

These solutions work for default cells. If you have your own custom cell, the easiest way to do it is make the label have constraints both to the left margin and the right margin, then create an outlet for your left margin constraint, and set its constant in the cellForRowAtIndexPath method:

cell.accessoryType = isChosen ? .checkmark : .none cell.leftMarginConstraint.constant = isChosen ? 40 : 0This way, the right margin which is added for your accessoryType is then added to the left as well. – via stackoverflow.com