jeudi 19 novembre 2015

If let statement with CLPlacemark

I'm trying to make an if let statement with the following:

if let p = CLPlacemark(placemark: placemarks?[0]) {

Currently it's telling me "Value of optional type 'CLPlacemark?' not unwrapped" and instructing me to put

(placemark: (placemarks?[0])!) {

However if I do that, it then tells me "Initializer for conditional binding must have optional type, not 'CLPlacemark'"

I honestly have no idea how to fix this and could use any help. Thanks in advance

Aucun commentaire:

Enregistrer un commentaire