Realm accessed from incorrect thread
I'm using serial GCD queue to work with realm. Application crashes with Realm accessed from incorrect thread exception when GCD starts to switch threads for the queue. Is there any way to bind given realm with a thread using GCD API? Here's a quick example self.realmQueue = dispatch_queue_create("db", DISPATCH_QUEUE_SERIAL); __block RLMRealm *realm = nil; dispatch_async(self.realmQueue, ^{ realm = [RLMRealm realmWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"temp"]]; }); self.motionManager = [[CMMotionManager alloc] init]; self.motionManager.accelerometerUpdateInterval = 0