I am creating a program to display textField characters in TableView using Parse, MBaaS on Swift, but the part that I pull TableView to update is not working.
I wrote a program like this, but when I pull it and update it, the same content appears double.
How do I update only the text that is already displayed on the screen without duplication?
I look forward to hearing from you.
I've never used Parse, but I'll write down what I noticed.
As PFQuery does not seem to be specifically narrowed down, I always get everything from query.findObjectsInBackgroundWithBlock.I added it to self.comments that already contain data, so it seems to have been added in duplicate.
Therefore, if possible, PFQuery will narrow it down by date, or if not, replace self.comments with the retrieved array
I think it's better to do so.
Also, query.findObjectsInBackgroundWithBlock seems to be handled in the background, but which thread is the callback called?It would be nice if the main thread is always referred to as a specific thread, but if not, there is a possibility of simultaneous execution failures.Also, tableView.reloadData must be run on the main thread.
© 2022 OneMinuteCode. All rights reserved.