diff --git a/MusicPlayer/APIController.swift b/MusicPlayer/APIController.swift index aec4266..bedc8f1 100644 --- a/MusicPlayer/APIController.swift +++ b/MusicPlayer/APIController.swift @@ -23,7 +23,7 @@ class APIController { func get(path: String) { let url = NSURL(string: path) let session = NSURLSession.sharedSession() - let task = session.dataTaskWithURL(url, completionHandler: {data, response, error -> Void in + let task = session.dataTaskWithURL(url!, completionHandler: {data, response, error -> Void in println("Task completed") if(error != nil) { // If there is an error in the web request, print it to the console diff --git a/MusicPlayer/Album.swift b/MusicPlayer/Album.swift index 466b5fb..7455812 100644 --- a/MusicPlayer/Album.swift +++ b/MusicPlayer/Album.swift @@ -52,7 +52,7 @@ class Album { var nf: NSNumberFormatter = NSNumberFormatter() nf.maximumFractionDigits = 2 if priceFloat != nil { - price = "$"+nf.stringFromNumber(priceFloat!) + price = "$"+nf.stringFromNumber(priceFloat!)! } } } diff --git a/MusicPlayer/DetailsViewController.swift b/MusicPlayer/DetailsViewController.swift index 677a102..f1869b3 100644 --- a/MusicPlayer/DetailsViewController.swift +++ b/MusicPlayer/DetailsViewController.swift @@ -27,7 +27,7 @@ class DetailsViewController: UIViewController, APIControllerProtocol, UITableVie override func viewDidLoad() { super.viewDidLoad() titleLabel.text = self.album?.title - albumCover.image = UIImage(data: NSData(contentsOfURL: NSURL(string: self.album!.largeImageURL))) + albumCover.image = UIImage(data: NSData(contentsOfURL: NSURL(string: self.album!.largeImageURL)!)!) if self.album != nil { api.lookupAlbum(self.album!.collectionId) diff --git a/MusicPlayer/SearchResultsViewController.swift b/MusicPlayer/SearchResultsViewController.swift index 8e9cbfa..3cb9cb7 100644 --- a/MusicPlayer/SearchResultsViewController.swift +++ b/MusicPlayer/SearchResultsViewController.swift @@ -56,7 +56,7 @@ class SearchResultsViewController: UIViewController, UITableViewDataSource, UITa if( image == nil ) { // If the image does not exist, we need to download it - var imgURL: NSURL = NSURL(string: urlString) + var imgURL: NSURL = NSURL(string: urlString)! // Download an NSData representation of the image at the URL let request: NSURLRequest = NSURLRequest(URL: imgURL)