Answer the question
In order to leave comments, you need to log in
XML serialization/deserialization on iOS?
Hello!
I'm looking for some kind of library for Objective-C and iOS, which makes it easy to serialize, deserialize objects. For example, how XStream does it in Java.
Can anyone recommend such a library?
Answer the question
In order to leave comments, you need to log in
Make sure the object classes you intend to serialize follow NSCoding.
NSKeyedArchiver and NSKeyedUnarchiver will help you with serialization.
Method on NSKeyedArchiver serializes to plist
+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path
Reverse on NSKeyedUnarchiver
+ (id)unarchiveObjectWithFile:(NSString *)path
Have a look at the Object Mapping module from RestKit (https://github.com/RestKit/RestKit)
I found this class on github: github.com/chadman/FellowshipOneAPIClient/blob/fa0898713d2af6f74bc7915be3d771dec3c4d870/FellowshipOneAPIClient/Class/Categories/NSObject+serializeToXml.m
There, of course, it is partially tailored for a specific developer class, but can be used for serialization
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question