I want to parse a JSON to object, but I have no idea how to cast AnyObject to String or Int since I\'m getting:
0x106bf1d07: leaq 0x33130(%rip), %rax
reminderJSON["id"] gives you an AnyObject?, so you cannot cast it to Int You have to unwrap it first.
reminderJSON["id"]
AnyObject?
Int
Do
self.id = reminderJSON["id"]! as Int
if you're sure that id will be present in the JSON.
id
if id: AnyObject = reminderJSON["id"] { self.id = id as Int }
otherwise