Why is combining used in an array of strings causing a segmentation error: 11 error when archiving in Xcode?

I spent hours trying to figure out why I keep getting segmentation error 11 when archiving in Xcode. I found out (by commenting on sections of code) using:

// If I comment out the second line with join, the archive works
var test = ["hello","world"]
let tested = " ".join(test)

Any ideas as to why this is happening and how to fix it?

+4
source share
1 answer

I ran into the same problem. I think this is a compiler error. The only workaround I found was to not use the connection.

var array = ["hello", "world"]
var resultString = ""
for (index, string) in enumerate(array) {
    if index > 0 {
        resultString += " "
    }
    resultString += string
}
0
source

All Articles