Overlapping accesses to 'data' (Xcode 10 beta, Swift 4.2)
yvbeek opened this issue · comments
In Xcode 10 beta with Swift 4.2 there are two build errors, in URL+XCGAdditions.swift (line 26 and 64):
Overlapping accesses to 'data', but modification requires exclusive access; consider copying to a local variable
I think the issue is that you are referring to data
inside of the withUnsafeMutableBytes
block. The block is reading the data
variable (with data.count
) while it is modifying the data
variable.
A potential fix would be to replace data
with $0.pointee
, but I'm not sure if that is just hiding the problem. Perhaps it would be better to extract the data.count
into a separate variable before you enter the block and use that inside the block.
This is actually already fixed on master.
There would need to be a release done w/ cocoapods in order to update dependencies easily ?
We will wait for updates for cocoapods
Any news on this?
Actually the data.count
can be replaced with lenght
:)
6.0.4 is now available as a pod etc. Fixes these issues (and a few more).
Hi @mithun-grmtech, you are most likely using the wrong version of XCGLogger.
If you're using Xcode 10.1, you should be using version 6.1.0 of XCGLogger, so make sure you specify that in your Podfile:
pod 'XCGLogger', '~> 6.1.0'
If you're still having issues after this, please ask a question on StackOverflow, and include the contents of your Podfile.
Hi @DaveWoodCom, Thank you
Now it's working fine.
👍