ios - PFImageView not showing up in the window -
i'm trying hand @ parse snapchat clon , going fine, when have display images user pfimageview not showing up, have no idea no errors show no subview.
the offending part:
func checkformessages() { if pfuser.currentuser()?.username != nil { println("checking msgs") var query = pfquery(classname: "image") query.wherekey("recipientusername", equalto: pfuser.currentuser()!.username!) var msgs = query.findobjects() println("\(msgs?.count) \(pfuser.currentuser()!.username!) recipientusername") var done = false if let msg = msgs as? [pfobject] { msgreceived in msg { if done == false { var imageview: pfimageview = pfimageview() imageview.file = msgreceived["image"] as? pffile imageview.loadinbackground({ (photo, error) -> void in if error == nil { var displayedimage = uiimageview(frame: cgrectmake(0, 0, self.view.frame.width, self.view.frame.height)) displayedimage.image = photo println(photo!.description) self.view.addsubview(imageview) //here should place in view } }) done = true } } } println(msgs?.count) } else { println("waiting user should not showing") } }
check supporting files/parsestarterproject-bridging-header.h file , see whether it's missing following line:
#import <parseui/parseui.h>
if so, sure add it.
Comments
Post a Comment