错误表示'new()'不适用于Swift :: use对象初始值设定项。不知道如何解决......
func showImage(notif:NSNotification) {
if let userInfo = notif.userInfo as NSDictionary! {
//the code below is the one i got error for
let photos:NSMutableArray = NSMutableArray.new()
let photo:IDMPhoto = IDMPhoto(image: userInfo["img"] as! UIImage!)
photos.addObject(photo)
let browser:IDMPhotoBrowser = IDMPhotoBrowser(photos: photos as [AnyObject]!)
browser.delegate = self
browser.displayActionButton = false
self.presentViewController(browser, animated: true, completion: nil)
}
}
答案 0 :(得分:1)
只需将NSMutableArray.new()
更改为NSMutableArray()
。