Ecco il codice:Impossibile convertire il valore di tipo 'Meme!' al tipo di argomento atteso '@noescape (Meme) getta -> Bool'
@IBAction func deleteMeme(sender: UIBarButtonItem) {
if let foundIndex = MemeRepository.sharedInstance.memes.indexOf(selectedMeme) {
//remove the item at the found index
MemeRepository.sharedInstance.memes.removeAtIndex(foundIndex)
navigationController?.popViewControllerAnimated(true)
L'errore avviene al metodo di .indexOf
a (selectedMeme)
.
Non può convertire il valore di tipo Meme!
al previsto tipo di argomento @noescape (Meme) throws -> Bool
Meme! è una struct per la mia app. Come lavoro attraverso questo?
struct Meme {
var topText : String!
var bottomText: String!
var image: UIImage!
var memedImage: UIImage!
init(topText: String, bottomText: String, image: UIImage, memedImage: UIImage) {
self.topText = topText
self.bottomText = bottomText
self.image = image
self.memedImage = memedImage
Grazie. Ha avuto difficoltà a cercare di risolvere questo. – nahwarang
Risposta perfetta. Ma perché questo non è ancora accettato? – BLC
@ BLC 2017 e ancora non è stato accettato –