I'm trying to access the url of an object stored in an array, but I'm getting errors no matters what methods I'm using.
let userPhotos = currentUser?.photos
for var i = 0; i < userPhotos!.count ; ++i {
let url = userPhotos[i].url
}
Here I get
Could not find member 'url'
and with a foreach:
for photo in userPhotos {
Utils.getImageAsync(photo.url , completion: { (img: UIImage?) -> () in
})
}
I get:
'[ModelAttachment]?' does not have a member named 'Generator'
My array is var photos: Array<ModelAttachment>? and my ModelAttachment looks like this:
class ModelAttachment :Model {
var id: String?
var url: String?
var thumb: String?
}
Any pointers to what I'm doing wrong would be great :)
[ModelAttachment], you should be able to use the for loops.