2016-08-02 2 views
-7

Comment analyser ces données dans UIImageView?Comment analyser ces données dans UIImageView?

Ceci est mon code:

photos =(
     { 
      height = 2988; 
      "html_attributions" =      (
      "<a href=\"https://maps.google.com/maps/contrib/109461257917544660371/photos\">Marie-Claude Brousseau</a>" 
       ); 
       "photo_reference" = "CoQBdwAAAD1yAyXPTuN2ZyRD4VZGAqVTT3ZCWSLe_RHSLx_ea-GLe0TsaRSpqIsHhvTj82GljPJG5y-Lrk6809jI5KzvcUjXroCcaAlEkgDLhQma5xsvA0vF4DwdoEZ0wWUZxXHs01BxedzegpQSgB4zVnzbUaAZaN_D5dEr0UOp4awIExe2EhAISA1lOL6VARBNLg9a1r1tGhQf3RgXpVfnPBtYPH6RY5pqmJE0mQ"; 
       width = 5312; 
      } 
     ); 
+1

Vous avez poser une question. Explique où tu es coincé. C'est juste du code. – Fogmeister

Répondre

-1

Utilisez la classe NSJSONSerialization comme suit:

NSData *data = [photos dataUsingEncoding:NSUTF8StringEncoding]; 
NSDictionary *propertyList = [NSJSONSerialization JSONObjectWithData:data 
    options:0 error:NULL]; 
+0

son ne fonctionne pas –

+0

Vous devez fournir "photos" comme un NSString pour le faire fonctionner: –

+2

Sa chaîne n'est pas json. On dirait qu'il "NSLog'd un dictionnaire – dan