I save to Core Data at this point:
Code:
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if ([elementName isEqualToString:@"Updates"])
return;
if ([elementName isEqualToString:@"Update"]) {
[appDelegate.infoGet addObject:aInfo];
Save to the file here
[aInfo release];
aInfo = nil;
}
else
[aInfo setValue:currentElementValue forKey:elementName];
[currentElementValue release];
currentElementValue = nil;
}
It looks to me there as if you are adding something to an array? Is "infoGet" defined as an array in your app delegate?
Now you didnt mention anything about Core Data so ill assume that you are just saving to a normal SQLite file? As that is the case i cant help you too much as i have been focusing on Core Data, but ill show you what i have to save to that. As i said this is in the "didEndElement" method:
Code:
else if ([elementName isEqualToString:@"item"]) {
NSManagedObject *newSalesInvoiceItem = [NSEntityDescription insertNewObjectForEntityForName:@"EntityName" inManagedObjectContext:newContext];
[newSalesInvoiceItem setValue:aSalesInvoiceItems.iicIcId forKey:@"iicIcId"];
NSError *error;
if (![managedObjectContext save:&error]) {
}
So i am opening up the Managed object for my entity (in bold) - this i think you may be able to skip, instead having it as the reference to your SQLite file, i the set the value from the server (italics) to the key in the database. At the end of it all i exit with a save.
Its a little side tracked from what you are looking for but hopefully it will help put you on the right lines.