Write JSON Response to .plist File

前端 未结 6 1529
遥遥无期
遥遥无期 2021-02-20 11:14

Frustration on the Top !!!

I am getting some JSON Response from the Service and I want to store it in the .plist file

6条回答
  •  清歌不尽
    2021-02-20 12:12

    If your dictionary contains NSNull, then writeToURL:atomically: will fail.

    For dictionaries, the keys must be NSStrings.

    The problem is that some valid JSON can't be converted to property lists. Also, some valid property lists can't be converted to JSON.

    Don't Forget, If you must use a property list, you will need to scan the entire dictionary and convert the nulls into something that can be saved in a property list file.

    Only Solution is that you have to check all the NULL Values and Replace it with @" ".

    Happy Coding...

提交回复
热议问题