I've just got a crash through when running with Xcode and I'm pretty sure there's no way it's my fault.
How can there be a bad access error? fetch
is created right before it so it must exist in memory, and self
is the context itself (this method is in a Swift extension on NSManagedObjectContext), and the context is one that exists permanently in the app and isn't released. It's created and is stored in the app delegate.
How can I prevent this, because I get it every now and then and it doesn't seem right.
The context is a private queue context, and this method is being called within that queue (context.performBlock
)