You need to create your model for Core Data. It cannot and will not just "read" the xml structure and create your model.
You do not need to create NSManagedObject
subclasses though.
Update
When you parse XML in Objective-C you do not need to create model objects at all. You can use instances of NSArray
and NSDictionary
to "model" anything that can come out of an XML file. Therefore you only need to create a Core Data model. In fact you can parse XML directly into Core Data without having an intermediary structure. The flow would be:
- Start stream read
- When an object is discovered create Core Data object
- Store data in CD object as it is read in
- If sub object is discovered go into recursion (step 2)
- When object is complete clear object and prepare for next object.
XML is a heavy format but it is no more complicated to parse than JSON.