NSJSONSerialization not creating mutable containers

前端 未结 4 1666
孤街浪徒
孤街浪徒 2021-02-07 10:05

Here\'s the code:

NSError *parseError;
NSMutableArray *listOfObjects = [NSJSONSerialization JSONObjectWithData:[@\"[]\" dataUsingEncoding:NSUTF8StringEncodin         


        
4条回答
  •  一向
    一向 (楼主)
    2021-02-07 10:32

    Others also take this for a bug, see

    1. https://github.com/couchbaselabs/TouchDB-iOS/issues/44 or
    2. https://github.com/johnlabarge/jlbiosutils/blob/master/jlbiosutils/DynamicProperties.m, for example.

    In the latter case you can see complete workaround also for empty dictionaries (see DynamicGetter(...) method).

提交回复
热议问题