1

I am having a map with some annotations and in another view i m showing a table view with all annotations over the map everything is going fine but every time when i am running my application the order of showing the annotations in the table view is different from previous, so can anyone explane me in what order table cells are created and in what order they are displayed.

I am sending the whole map object to my table view to retrieve the annotations over the map i.e [mymap annotations].

Thanks for helping me !

superGokuN
  • 1,399
  • 13
  • 28

2 Answers2

2

Despite the name, the map view keeps the annotations not as an array, but as an NSSet for optimization reasons. As NSSets are harder to use, it sends an NSArray when asked for the annotations, but internally it is not an NSArray. As you may know, NSSets are unordered.

To have the same order, you should create a property to hold the array of annotations, and not rely on [mymap annotations].

Cyril Godefroy
  • 1,400
  • 12
  • 15
0

This question is similar to one that I did a week ago, is not exactly the same problem but you could figure out how to solve.

Community
  • 1
  • 1
Mat
  • 7,613
  • 4
  • 40
  • 56