NSJSONSerialization should be able to handle and create NSMapTable/NSPointerArray
| Originator: | zach | ||
| Number: | rdar://14487370 | Date Originated: | 18-Jul-2013 04:23 PM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X SDK | Product Version: | 10.8 |
| Classification: | Enhancement | Reproducible: | n/a |
18-Jul-2013 04:23 PM Zach Drayer: Summary: It would be excellent if NSJSONSerialization had an option to deserialize JSON into NSMapTable/NSPointerArray. Something like NSJSONReadingPointerContainers. Differences vs current behavior: The primary difference in this versus NSArray/NSDictionary would be that when deserializing to NSMapTable or NSPointerArray and there is a `null` entry in the JSON, the key/index would have nil in it, instead of `[NSNull null]`. The same goes for transforming a Foundation object into JSON data, in reverse. If given NSMapTable or NSPointerArray and there is a nil entry, it would produce the `null` value for JSON. Primary use cases: This feels like it would allow for more idiomatic Objective-C to be written when dealing with JSON parsing. It would allow for nil-messaging when accessing collections (as opposed to having to special-case and check for NSNull).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!