XML Parsing Type 3 in IOS

Create a new project in xcode under Single View Application, If You have a XML file content as, Books Book title Who Moved My Cheese? title author Spencer Johnson author Book Books then put the above xml content into a texteditor and name it as you want and with the extension of xml and import into your project, In ViewController.h #import @interface ViewController : UIViewController @end In ViewController.m #import “ViewController.h” @interface ViewController () { NSXMLParser *parser; NSMutableDictionary *item; NSMutableString *title; NSMutableString *author; NSString *element; }…

Continue reading »

XML Parsing Type 2 in IOS

Create a new Project in xcode and in our case the xml file has the content, put this in a texteditor and save the file name as samplexml with the extension of xml and import into your project. Final Design and output looks like this, Create a class named Book under the subclass of NSObject In Book.h #import @interface Book : NSObject { NSInteger bookID; NSString *author; NSString *title; NSString *summary; } @property (nonatomic, readwrite) NSInteger bookID; @property (nonatomic, retain) NSString *author; @property (nonatomic, retain)…

Continue reading »

XML Parsing Type 1 in IOS

Create a new project in xcode and Click on the Project Name — Build Phases — Link Binary With Librarys + sign and add libz.dylib And Download the TBXML file from the below link, http://www.mediafire.com/folder/b935d83zaez5r/TBXML Add the downloaded file into your project. Go to File — New — File — Under IOS Section — Others — Select Empty — Next — save the file name as asdf.xml In the asdf.xml file add the xml content as, This is from xml file. In ViewController.h #import #import…

Continue reading »