I'm testing this code in playground. What I don't understand is, why is result always nil? Thanks for help
var value: String!
let key = "key24"
if value == nil{
value = "hehe"
let valueNS = NSString(string: value)
NSUserDefaults.standardUserDefaults().setValue(valueNS, forKey: key)
}
var result: AnyObject? = NSUserDefaults.standardUserDefaults().objectForKey(key)
print(result)