Funnybear
Funnybear

Reputation: 71

How can I create MKTileOverlay dynamically according to specific URLs from an NSMutableArray

I have an NSDictionnary inside an NSMutableArray (dateArrayURL)

It looks like this :

dateArrayURL: (
    {
    date = "2016-10-04 13:00:00 +0000";
    urlImage = "http://www.xxx/XX/XX.jpg";
},
    {
    date = "2016-10-04 12:45:00 +0000";
    urlImage = "http://www.xxx/XX/XX.jpg";
},
    {
    date = "2016-10-04 12:30:00 +0000";
    urlImage = "http://www.xxx/XX/XX.jpg";
},
    {
    date = "2016-10-04 12:15:00 +0000";
    urlImage = "http://www.xxx/XX/XX.jpg";
},

Note that the URL Images are different for each dates.

Now I would like to build an MKTileOverlay for each date/URL I have in my MutableArray with the following method :

tileOverlay = [[MKTileOverlay alloc] initWithURLTemplate:urlTemplate];

Should I loop for each of my element in the Array, and create an MKTikeOverlay with the appropriate URL? How can I do this, I'm stuck at accessing elements in the dictionary/array.

Upvotes: 0

Views: 175

Answers (1)

Funnybear
Funnybear

Reputation: 71

This question is solves thanks to @Larme who helped me in the comments.

Upvotes: 0

Related Questions