json - Iterate over AnyObject. Error: Type 'AnyObject' does not conform to protocol 'SequenceType' -


i'm using alamofire data json file. example of output: [{"image_name":"vacation"},{"image_name":"graduation"}]

i have problem when try access information json output.

    alamofire.request(.get, url).responsejson { (response) -> void in         if let json = response.result.value {             json in json{                 print(json)             }         } 

the problem have json output anyobject , cannt iterate on anyobject. if following:

print(json[0]["image_name"]) 

then can see output correctly. how can iterate on anyobject?

you may need explicitly state type of json array of dictionaries:

if let json = response.result.value [[string : anyobject]] {     // ... } 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -