Closed aelam closed 3 years ago
just change the instance type of array
in Class NSArray to private ArrayList<NSObject> array;
can save a lot of energy
When I try to convert a plist to json, the structure goes to weird when It parse NSArray, I think it's the reason that it doens't implement List
Have you tried converting the NSObjects to Java Objects before passing them to the JSON serializer? See https://3breadt.github.io/dd-plist/com/dd/plist/NSObject.html#toJavaObject--
I just did a general operation, convert a NSDictionary object which contains NSArray to json string, I didn't convert to Java objects, but i changes the internal class from Array to ArrayList, it can be processed greatly
BTW the json way just work for plain XML PropertyList and I need serializers for NSNumber and NSString
AND it doesn't work for NSData, i can understand it, im looking for a better to convert plist to objects like gson does.
I will appreciate if you have any ideas
Please do not convert the NSObjects directly to JSON. The classes were not designed for that. Rather as mentioned, convert them first to POJOs which are most likely supported by any JSON serializer.
When I try to convert a plist to json, the structure goes to weird when It parse NSArray, I think it's the reason that it doens't implement List