Giter Site home page Giter Site logo

ClusteringManager crashing about cluster HOT 8 CLOSED

efremidze avatar efremidze commented on September 27, 2024 1
ClusteringManager crashing

from cluster.

Comments (8)

efremidze avatar efremidze commented on September 27, 2024

Ill take a look asap

from cluster.

efremidze avatar efremidze commented on September 27, 2024

Try the latest commit from the master branch. I fixed a threading bug.

from cluster.

VSmallbon avatar VSmallbon commented on September 27, 2024

I did a pod update but my project is still using Cluster 1.0.7? Is this the right version? I also can't see any recent commit messages on the master branch in git. The crash still occurs, so maybe I can't see the latest version?

from cluster.

efremidze avatar efremidze commented on September 27, 2024

pod 'Cluster', :git => 'https://github.com/efremidze/Cluster.git'

from cluster.

VSmallbon avatar VSmallbon commented on September 27, 2024

I'm still getting the crash even though I updated to the latest version. I'm retrieving house status values in a url task and then refreshing the page. Would that cause a crash?

func getHomeStatus() -> Void {
    let todoEndpoint = "https://lxxxxx/status.php"
    guard let url = URL(string: todoEndpoint) else {
        print("Error: cannot create URL")
        return
    }
    let urlRequest = URLRequest(url: url)
    
    // set up the session
    let config = URLSessionConfiguration.default
    let session = URLSession(configuration: config)
    
    // make the request
    let task = session.dataTask(with: urlRequest) {
        (data, response, error) in
        // check for any errors
        guard error == nil else {
            print("error calling GET on /todos/1")
            return
        }
        // make sure we got data
        guard let responseData = data else {
            print("Error: did not receive data")
            return
        }
        
        // parse the result as JSON, since that's what the API provides
        
        let string1 = String(data: responseData, encoding: String.Encoding.utf8) ?? "Data could not be printed"
        
        let temp = self.convertToDictionary(text: string1) as! [String : String]
        if (temp != self.addressStatus){
            self.addressStatus = temp
            let annotations = self.mapView.annotations
            
            DispatchQueue.main.async {
                
                self.mapView.removeAnnotations(annotations)
                self.mapView.addAnnotations(annotations)
                self.mapView.reloadInputViews()
            }
            
        }
        
    }
    task.resume()
    
    
}

from cluster.

efremidze avatar efremidze commented on September 27, 2024

what is mapView.reloadInputViews()?

from cluster.

VSmallbon avatar VSmallbon commented on September 27, 2024

It reloads the Map Kit View, however I think I found the problem. I have this function:

override func viewWillAppear(_ animated: Bool) {
    self.mapView.showAnnotations(self.clusterManager.annotations, animated: true)
}

Which I'm using to rezoom the map every time the user navigates back to the view. I've removed the need of this function from the code and I no longer get the index out of bounds error.

from cluster.

efremidze avatar efremidze commented on September 27, 2024

So the problem is solved?

from cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.