             
             guard data != nil else {
                 print("Error performing Yahoo query when updating current currencies.")
+                hideActivityIndicator()
                 return
             }
             

    
    func updateCurrentCurrencies() {
        
        // Start by showing the network indicator.
        UIApplication.sharedApplication().networkActivityIndicatorVisible = true
        
        let url = NSURL(string: "https://query.yahooapis.com/v1/public/yql?q=" +
            "select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(" +

                fetchedOutputRate = try xml["query"]["results"]["rate"].withAttr("id", "USD" + self.outputCurrency.code)["Rate"].element!.text!
            } catch {
                print("Error fetching currencies: \(error)")
                hideActivityIndicator()
                return
            }
            
            // Hide the network indicator.
            hideActivityIndicator()
            
            // Update UI on main thread.
            dispatch_async(dispatch_get_main_queue()) {
                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.inputCurrency.code, "currencyRate": fetchedInputRate])
                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.outputCurrency.code, "currencyRate": fetchedOutputRate])
                print("Updated input and output currency rates.")
            }
            
            // CoreData setup.
            let managedObjectContext: NSManagedObjectContext!
