lundi 1 juin 2015

What Is The Correct Way To Write This Multiple Condition If-Statement?

What is the correct way to right this two condition if-statement?

I'm getting a compiler error that says could not find an overload for '==' that accepts the supplied arguments

If I use just one or the other it's fine but when I add a second one it doesn't work.

    for item in imageOutlets {

        if collectionObjects.count > 0 {

            let imageObject = self.collectionObjects.objectAtIndex(count) as! PFObject
            let imageFile = imageObject.objectForKey(smallThumbImage) as! PFFile
            imageFile.getDataInBackgroundWithBlock({ (data, error) -> Void in

                if (error == nil) || (imageFile != nil) {

                    item.image = UIImage(data: data!)

                } else {

                    item.image = UIImage(named: "placeholder")
                    println("error loading image")
                }

Aucun commentaire:

Enregistrer un commentaire