Starting and invoking methods on separate execution threads is made easy in Objective-C if we use NSThread
objects.
In Xcode, click on the file named
BTSAppDelegate.m
in the project navigator and locate the method namedapplicationDidFinishLaunching:
.There is one small piece of housekeeping that needs to be done. We created a member variable (
mCurrencyRates
) to reference our list of currencies and exchange rates but we never created the object. We need to create the object before we can add anything to it. Add the following line of code to create theNSMutableDictionary
object:- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application // Create a mutable NSDictionary so that we can // save the exchange rate information mCurrencyRates = [[NSMutableDictionary alloc] init];
After that bit of housekeeping, add the following code to change the circular progress indicator...