swift - Array (class) filled with non nil values stays empty -


i having trouble filling array of customclass.

i try fill jsonfile. during json parsing (using swiftyjson) loop , fill array. problem is, @ end of loop, still empty. tested in different ways, , here code:

enter image description here

that's file problem is. in loop fill annotation, add append array. problem print return. here part of it:

enter image description here

it's small part of huge jsonfile. and, tmpannot.name correctly printed every iteration. when comes array, nothing.

so i'm completly lost , hope me ^^

(and information, here custom class) :

enter image description here

and btw, tried print array.count, , it's nil

im sorry if question has been posted. couldn't find in entire website.

change jsonannotationlist declaration non-optional , assign empty array

var jsonannotationlist: [ugoannotation] = [] 

you see, have never created array there nothing printed.

the whole point of optionals use them sparingly, not everywhere.


Comments