1
在Xcode中6測試版7,我不能把一個的UIImage在AnyObject陣列:如何將UIImage放入AnyObject數組?
var objects = [pizzaImage.image, title, ingredients.text]
錯誤: Cannot convert the expression's type 'Array' to type 'ArrayLiteralConvertible
「
在測試沒有問題,6
編輯 這是完整的代碼,嘗試了一切,但沒有運氣:
var objects = [pizzaImage.image!, title, ingredients.text!]]
var act = UIActivityViewController(activityItems: objects, applicationActivities: nil)
self.presentViewController(act, animated: true, completion: nil)
它與此有關嗎? http://stackoverflow.com/questions/25649875/xcode-6-beta7-nsdictionary-to-swift – Paulw11 2014-09-03 21:15:41
解包圖像在這種情況下沒有效果,對不起 – Enlil 2014-09-03 21:22:52
@MarcelloCat:'ingredients.text'也必須解包。 – 2014-09-03 21:32:20