i have string contains json array. mapping string key in dictionary. doing adds "/" in string. again, i'm converting string further nsdata. please me out.
code generate json string:
int = 0; nsmutablearray *contacts = [nsmutablearray array]; (i = 0; < all_contacts.count; i++) { [contacts addobject:@{@"phone" : all_contacts[i]}]; } nserror *error; nsdata *jsondata = [nsjsonserialization datawithjsonobject:contacts options:0 error:&error]; if (!jsondata) { //error here } else { nsstring *jsonstring = [[nsstring alloc] initwithdata:jsondata encoding:nsutf8stringencoding]; } before converting string nsdictionary
[{"phone":5555648583},{"phone":5554787672},{"phone":952365285},{"phone":5555228243},{"phone":5557664823},{"phone":5556106679}] after converting nsdictionary
{ key = "[{\"phone\":5555648583},{\"phone\":5554787672},{\"phone\":952365285},{\"phone\":5555228243},{\"phone\":5557664823},{\"phone\":5556106679}]"; } i want convert nsdictionary nsdata without appending "/" characters?
the backslash characters inserted presentation only. if type po jsonstring in console, verify there aren't any.
Comments
Post a Comment