相册App swift lang,情侣功能有误

时间:2015-07-09 21:18:01

标签: ios swift

  1. 错误消息"'字符串?'不能转换为' String'"

    override func prepareForSegue(segue: UIStoryboardSegue, sender:                                   AnyObject?) {
    **if(segue.identifier as String == "viewLargePhoto")**{
        let controller:ViewPhoto = segue.destinationViewController as     ViewPhoto
    let indexPath: NSIndexPath =             self.collectionView.indexPathForCell(sender as UICollectionViewCell)
    
    controller.photoAsset = self.photoAsset
    controller.assetCollection = self.assetCollection
    
  2. 错误消息:无法找到成员' AspectFill'

    let asset: PHAsset = self.photoAsset[indexPath.item] as! PHAsset
    PHImageManager.defaultManager().requestImageForAsset(asset,         targetSize: PHImageManagerMaximumSize, contentMode: .AspectFill, options:         nil,
        resultHandler: {(result:UIImage!, info:NSDictionary!)in
        cell.setThumbnailImage(result)
    })
    
            return cell
    
  3. 请帮助并谢谢

1 个答案:

答案 0 :(得分:1)

尝试在info函数中省略resultHandler的显式类型声明。
为我工作。