Q:

parse ObjectsDidLoad called twice

I have a PFQueryTableViewController which contain a segmentedControl which switch to a MKMapView. When this is clicked i want to load the geoPoint objects from objectsDidLoad, but since the objectsDidLoad is called twice it will duplicate the annonationPoints on the map. Why is it being called twice?
override func objectsDidLoad(error: NSError!) {
    super.objectsDidLoad(error)
    if error == nil {
        println("lol")
    }
}

cache
    if self.objects.count == 0 {
        query.cachePolicy = kPFCachePolicyCacheThenNetwork;
    }

A:

kPFCachePolicyCacheThenNetwork will result in two calls to objectsDidLoad - The first when the objects are retrieved from cache and then again when the objects are retrieved from the network.
You should remove all existing map annotations at the start of this method - Remember to perform this on the main thread.
See also - https://www.parse.com/questions/determine-if-query-result-or-object-originates-from-cache

