Warning - Feedback UIFeedbackRetargetBehavior 0x174107b30 prepared = 0 is deactivated more times when it was activated

When working with multi-threaded data with master data in ios I use this code

func saveCity(_ name: String) {
 let managedContext =
            self.persistentContainer.viewContext
        let privateMOC = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
        privateMOC.parent = managedContext
        privateMOC.perform {
            let entity =
                NSEntityDescription.entity(forEntityName: Constants.Entity.City,
                                           in: privateMOC)!

            let city = NSManagedObject(entity: entity,
                                       insertInto: privateMOC)

            city.setValue(name, forKeyPath: Constants.JSONCityResponseKey.Name)
            do {
                try privateMOC.save()
                managedContext.performAndWait {
                    do {
                        try managedContext.save()
                    } catch {
                        fatalError("Failure to save context: \(error)")
                    }
                }
            } catch {
                fatalError("Failure to save context: \(error)")
            }
        }
}

and call this func as

    DispatchQueue.global(qos: .default).async{
                            for data in response!{
                                CoreDataManager.sharedInstance().saveCity(data.value(forKey:Constants.JSONCityResponseKey.Name) as! String)
                           }
    }

I received this warning in my application. I work in Swift 3 and Xcode 8.1 and iOS 10.1.

can someone say what it is. how can i fix this.?

+4
source share

Source: https://habr.com/ru/post/1663301/


All Articles