Search code examples
xcodeseparator

Xcode is telling me to put in expected ',' separator


xcode is telling me to put in expected ',' separator. Below is my code. even when i put in what Xcode tells me I still get an error. Does anyone know what I could be doing wrong?

        } else {

            if let p = placemarks?[0] {

                var subThoroughfare:String = ""

                if (p.throughfare != nil {

                    subThoroughfare = p.subThoroughfare

            } // there are telling me to put this ',' here


                self.addressLabel.text = "\(subThoroughfare) \(p.thoroughfare) \n \(p.subLocality) \n \(p.subAdministrativeArea) \n \(p.postalCode) \n \(p.country)"

                } // xcode is telling me to put this ',' here

        } // xcode is telling me to put this ',' here            



    })

Solution

  • Change this portion of your code and check if it still shows the error:

    if (p.throughfare != nil) {  
      subThoroughfare = p.subThoroughfare
    }
    

    If it still show the error please show the if part also in your code it will help in understanding the full code as there look like extra bracket at end also