An iPhone app is a program that runs
on our iPhone/iPod Touch. It enables us to accomplish a certain task. They could
be utility apps, games, enterprise apps, entertainment apps, apps to access our
bank account etc.
NSXMLParser is a forward only reader or an event driven parser. What it means is, an event is raised whenever the parser comes across a start of an element, value, CDATA and so on. The delegate of NSXMLParser can then implement these events to capture XML data. Some of the events are raised multiple times like the start of an element, value of an element and so on. Since NSXMLParser is known as an event driven parser, we can only read data at the present node and cannot go back. The iPhone only supports NSXMLParser and not NSXMLDocument , which loads the whole XML tree in memory. Books Application To understand how to use an instance of NSXMLParser, let’s create a simple navigation based application where we will list the title of the book in the table view and upon selecting a title, display the detail information in a detail view. Click here to see the sample XML file, used in this application. Create a new application in XCode by selecting Navig...
To start, launch Xcode and create a new project by going to File > New Project. Under the iPhone OS section of the New Project window select View-Based Application. You should be presented with the following window: Creating the UI We’re going to start with creating the UI. iPhone applications use files called xib or nib files to help separate the coding from the design. To open the default xib file select the Resources folder on the left menu, and open HelloWorldViewController.xib. This should open Interface Builder. What we want to do is create the interface for our HelloWorld! application. To start go to Tools > Library, which should open up the Library of all the different UI elements you can use. In your HelloWorldViewController.xib window double click the View object to open up the view. This is what your application will look like when you load it. What we want to do here is...
In the days before object-oriented programming (and even for a time after object-oriented programming became popular) there was a tendency to develop applications where the code for the user interface was tied tightly to the code containing the application logic and data handling. This coupling made application code difficult to maintain and locked the application to a single user interface. If, for example, an application written for Microsoft Windows needed to be migrated to Mac OS, all the code written specifically for the Windows UI toolkits had to be ripped out from amongst the data and logic code and replaced with the Mac OS equivalent. If the application then needed to be turned into a web based solution, the process would have to be repeated again. Attempts to achieve this feat were usually found to be prohibitively expensive and ultimately ended up with the applications being completely re-written each time a new platform needed to be targeted. The goal of t...