ios - cannot assign a value of type json to a value of type NSArray -


i trying send info segue following error cannot assign value of type json value of type nsarray

when try do:

self.pageimages = apiresult["images"] 

i have apiresult setup as:

var apiresult: json! = [] 

then i'm using alamofire swiftyjson in order fetch result , cast json, need nsarray.

my data returned as:

{     "somedata": {         info     },     "somedata": {         info..     },     "images": [        "url1", "url2", "url3"     ] } 

if apiresult json object returned swiftyjson , if apiresult["images"] array of urls want assign pageimages array variable, have use array property of json typed swiftyjson object:

self.pageimages = apiresult["images"].array 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -