I get a return number(0 for success, 1 for failure) form sever made by php so I want get this number to judge my operation succeeded or not. I use this :
var str1 :String = NSString(data: d, encoding: NSUTF8StringEncoding)!
let str2 = "1"
println(str1) // output is 1
println(str2) // output is 1
if(str1==str2){println("same")} //but the two is not same
so I debug for this and I get this result: //str1 _countAndFlags UWord 13835058055282163717 -4611686018427387899 //str2 _countAndFlags UWord 1 1
And I try to use toInt. I get 1383... form str3 and 1 form str4 So how can I do to solve this problem. Thank you very much.
See Question&Answers more detail:os