I
I
igofed2011-12-10 00:11:07
Objective-C
igofed, 2011-12-10 00:11:07

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

3 answer(s)
L
Limosha, 2011-12-10
@Limosha

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

I
Infernal, 2011-12-10
@Infernal

Have a look at the Object Mapping module from RestKit (https://github.com/RestKit/RestKit)

P
petrovi4, 2011-12-11
@petrovi4

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 question

Ask a Question

731 491 924 answers to any question