The latest version of the app (1.2.2.191) crashes when tapping the 'view tips and tricks' on the about view.
iPhone 4s/iOS 8.1.3, on the chance it's not universal
The latest version of the app (1.2.2.191) crashes when tapping the 'view tips and tricks' on the about view.
iPhone 4s/iOS 8.1.3, on the chance it's not universal
This will be fixed in the next release. There's weird stuff going on with Swift here.
The following code is working in debug builds but not release builds:
if let tips = NSArray(contentsOfFile: path) as? [String] {
return tips
} else {
fatalError("Could not load tips at path: \(path)")
}
I broke it down one step further and found that this code crashes:
if let tips = NSArray(contentsOfFile: path) {
return tips as [String]
}
while this code works:
if let tips = NSArray(contentsOfFile: path) {
println(tips)
return tips as [String]
}
Because that's ugly, I'll be doing this instead:
if let tips = NSArray(contentsOfFile: path) {
return map(tips, { $0 as String })
// return tips as [String] // This fails in release builds. 😢
}
I'm suspecting that the casting behavior is different between the two builds and that there's a problem with deserialized arrays that they won't cast until fully resolved. I'll be testing this out in the latest Xcode beta and filing a radar.