I am always getting the fatal error: unexpectedly found nil while unwrapping an Optional value. but if i look the the fileURL variable it has some values. please let me know what i missed here:
Error:
Optional(http:/files.parsetfss.com/461a4eda-d153-4d46-bd85-28ddd355a94c/tfss-03d4eb57-51cb-424d-8c90-2d8a89429203-00255--How_To_Build_A_Loving_Family.mp3 -- file:///)
fatal error: unexpectedly found nil while unwrapping an Optional value
Code:
if let audioFile = object["audioFile"] as? PFFile {
var audioPath: String = audioFile.url!
var fileURL = NSURL(fileURLWithPath: audioPath as String)
println(fileURL)
audioPlayer = AVAudioPlayer(contentsOfURL: fileURL, error: nil)
audioPlayer.volume = volumeSlider.value
audioPlayer.play()
}