How can I convert NSDictionary to NSData and vice versa?

前端 未结 6 1107
旧时难觅i
旧时难觅i 2020-12-02 04:14

I am sending NSString and UIImage using bluetooth. I decided to store both in a NSDictionary and then convert the dictionary to

6条回答
  •  情歌与酒
    2020-12-02 04:25

    Please try this one

    NSError *error;
    NSDictionary *responseJson = [NSJSONSerialization JSONObjectWithData:webData
                                    options:NSJSONReadingMutableContainers
                                    error:&error];
    

提交回复
热议问题