Once our program has retrieved the raw XML file, we need to examine it and extract the information of interest. This is called parsing the file.
In Xcode, click on the file named
BTSAppDelegate.h
in the project navigator and add the following defines that will be used to extract information from the XML file after it is downloaded:/* Global Currency defines */ // The European Central Bank exchange rate XML File #define D_ECB_RATES_URL @"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml" // The path to the last update time in the XML tree #define D_XML_PATH_TIME @"/gesmes:Envelope/Cube/Cube" // The path to the exchange rates in the XML tree #define D_XML_PATH_RATES @"/gesmes:Envelope/Cube/Cube/Cube" // The popup menu title #define D_SELECT_CURRENCY @"Select Currency" // The keys for the XML attributes #define kTimeKey @"time" #define kCurrencyKey @"currency" #define kRateKey @"rate"
Add the Member variables to
BTSAppDelegate.h
. These...