Swift can't retrieve images from parse.com

I was using 6.4 of Xcode and it was working fine but when I updated to Xcode 7 it seems like query isn’t working for photos.

I’m getting username on table view but the images not showing I get this error when testing on simulator iPhone 5:

  • Google Api error “Multiple methods named 'initWithArray:' found”
  • How to add NSExceptionDomains to plist of xcode Version 7.0.1?
  • Error: Use of unresolved identifier 'kCGBlendModeMultiply'
  • 'Google/Analytics.h' file not found - XCode 7
  • What is nonnull in objective C?
  • What does NSObject.BroadSystemFontWeights warning message mean?
  • App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

    And when I test it on iPhone 6 I got this error :

    fatal error: unexpectedly found nil while unwrapping an Optional value
    (lldb)

    and showing me a red thread on this line :

    query.whereKey("user", equalTo: PFUser.currentUser()!.username!) 
    

    2 Solutions Collect From Internet About “Swift can't retrieve images from parse.com”

    Apple now forcing dev to use ATS(HTTPS), but you can disable it in info.plist by adding this

    <key>NSAppTransportSecurity</key>  
         <dict>  
              <key>NSAllowsArbitraryLoads</key><true/>  
         </dict>
    

    Should look like this enter image description here

    Visit Apple docs for more details about ATS and please watch this WWDC video session

    Your second issue is explain below

    FPUser.currentUser can return nil if user logged out, and you are using ! force unwrapping and then calling username, so if user is not logged in then currentUser will return nil and you will end up calling username on nil, hence you are getting this crash, you should do something like this.

    if let user = PFUser.currentUser()
    {
       query.whereKey("user", equalTo: user.username!) 
    }
    else
    {
       // show login ui 
    }
    

    Apple is now forcing HTTPS connections, that is the App Transport Security message. You are still sending over clear text HTTP.