ios - Swift can't retrieve images from parse.com -
i using 6.4 of xcode , working fine when updated xcode 7 seems query isn't working photos.
i'm getting username on table view images not showing error when testing on simulator iphone 5:
app transport security has blocked cleartext http (http://) resource load since insecure. temporary exceptions can configured via app's info.plist file.
and when test on iphone 6 got error :
fatal error: unexpectedly found nil while unwrapping optional value
(lldb)
and showing me red thread on line :
query.wherekey("user", equalto: pfuser.currentuser()!.username!)
apple forcing dev use ats(https), can disable in info.plist adding this
<key>nsapptransportsecurity</key> <dict> <key>nsallowsarbitraryloads</key><true/> </dict>
visit apple docs more details ats , please watch wwdc video session
your second issue explain below
fpuser.currentuser
can return nil if user logged out, , using !
force unwrapping , calling username
, if user not logged in currentuser
return nil , end calling username
on nil
, hence getting crash, should this.
if let user = pfuser.currentuser() { query.wherekey("user", equalto: user.username!) } else { // show login ui }
Comments
Post a Comment