2015-01-21 64 views
0

嗯,我有这个问题!我试图做一个应用程序,加载时它第一次使用FB配置文件图片。用UIImageView更改FBProfilePictureView(或加载UIImage)Swift

但他们可以稍后改变图像。

现在即时尝试使用FBProfilePictureView查看整个时间。

并尝试将其转换为Swift。它没有按计划工作。

let imageURL = NSURL(string: img.valueForKey("url") as String) 
     Alamofire.request(.GET, imageURL!).response() { 
      (_, _, data, _) in 

      let image = UIImage(data: data! as NSData) 
      for obj in self.fb_background.subviews{ 

       if(obj.isKindOfClass(UIImageView)){ 

        obj.image = image 
       } 
      } 

这不起作用obj不是recouldnised为的UIImageView

它如何我可以开始工作?

+0

[FBProfilePictureVIew](https://developers.facebook.com/docs/reference/ios/current/class/FBProfilePictureView)是UIView的子类。所以当你用'UIImageView'在你的'self.fb_background.subviews'视图数组中反思它时,它实际上是错误的。 – 2015-01-28 15:07:10

回答

相关问题