IOS executes Tableview.selectrow invalid solution in TableView side-slip Event

Source: Internet
Author: User

Very strange problem, when executing the default selection of a cell, suddenly found that this sentence does not work

(My scene is: After the current cell side-slip Delete, the previous cell is selected by default)

After a long day, finally found that the culprit is because: this sentence is written in the way of the slide-off event.

Func TableView (_ Tableview:uitableview, Commit Editingstyle:uitableviewcelleditingstyle, Forrowat Indexpath: Indexpath) {     //}

Tried a few times, in the normal function of the body to execute this sentence, are normal, here is invalid.

The reason for the moment unexpectedly, speculation is because the cell recovery after the system events blocked the sentence execution

Temporary solution:

1. Transfer the place of execution of this sentence

2, plus a delay processing

The second solution I used, deferred 0.5s execution, found no problem.

Know the reason of the little partner welcome message to inform the next ~3q

IOS executes Tableview.selectrow invalid solution in TableView side-slip Event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.