В моем приложении iOS 5 у меня есть NSString
, который содержит строку JSON. Я бы хотелось бы десериализовать это строковое представление JSON в собственный объект NSDictionary
.
"{\"password\" : \"1234\", \"user\" : \"andreas\"}"
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:@"{\"2\":\"3\"}"
options:NSJSONReadingMutableContainers
error:&e];
-[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x1372c
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x1372c'