When using NSScanner, the following crashes:
var s: String?
var b: NSString?
let scn = NSScanner(string: "andgostring")
scn.scanUpToString("go", intoString: &b)
b = NSString(string:"http")
s = b // <--- Crashes here with EXC_BAD_INSTRUCTION(code=EXC_i386_INVOP,subcode=0x0
What's wrong here?
Aucun commentaire:
Enregistrer un commentaire