Simultaneous accesses to 0x1c0a7f0f8, but modification requires exclusive access error on Xcode 9 beta 4

后端 未结 11 1837
孤城傲影
孤城傲影 2020-11-29 05:15

my project uses both Objective-C and Swift code. When a user logs in, it calls a set of apis for user preference, I have a DataCoordinator.swift class which schedules the AP

11条回答
  •  长情又很酷
    2020-11-29 05:38

    I think this 'bug' may be a Swift 4 'feature', specifically something they call 'Exclusive access to Memory'.

    Check out this WWDC video. Around the 50 minute mark, the long-haired speaker explains it.

    https://developer.apple.com/videos/play/wwdc2017/402/?time=233

    You could try turning the thread sanitizer off in your scheme settings if you're happy to ignore it. However, the debugger is trying to tell you about a subtle threading issue so it's probably a better use of your time to try to figure out why you've got something writing to your array at the same time it's being read from.

提交回复
热议问题