I am trying to request images from Parse, and I continue to work in fatal error: unexpectedly found nil while unwrapping optional value. I'm not sure if this is due to a recent update to Swift and Xcode, so maybe this is at the end of Parse or it could be a user error.
Only those getDataInBackGroundWithBlockwill take values NSData?and NSError?as optional. If I try to expand them or use other types, it will not compile.
PFQueryreturns data as expected. This is only when trying to switch from PFFileto NSDatato a call getDataInBackGroundWithBlockthat arose from the problem.
The frame is connected and running. I tested it quite a bit.
Here is the call stack: 
12 . . , Swift Xcode, .
, , :
Parse " "
Parse and Swift 1.2 issue
Parse getDataInBackgroundWithBlock
Parse sdk -
Parse docs:
https://www.parse.com/docs/ios_guide#files/iOS ( )
var photoArray: Array<UIImage> = []
override func viewDidLoad() {
super.viewDidLoad()
callPFObjectQuery()
let testObject = PFObject(className: "QuestionMaster")
testObject["foo"] = "bar"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
}
func callPFObjectQuery() {
var finalObjects: [PFObject] = []
var nsdataObjects: NSData?
var query: PFQuery = PFQuery(className: "QuestionMaster")
query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error: NSError?) -> Void in
for object in objects! {
let imageFiles = object["questionImage"] as! PFFile!
if error == nil {
dispatch_async(dispatch_get_main_queue()) {
let image = UIImage(data: imageData!)
self.photoArray.append(image!)
println(self.photoArray[0])
}
}
}
}
}
}
, 12 2015 . - Swift 1.2: , , 1 . - , , , . , , (6-8k ) Parse SDK Swift. , . Uttam Sinha , getDataInBackGroundWithBlock . , . Ingouackaz for-loop, getDataInBackGroundWithBlock .
, , , . , , PFObject. , getDataInBackGroundWithBlock .
object["questionImage"] , , object.valueForKey("questionImage"), . "questionImage" , .
PDF Parse. . , , . , .