Prevent a method from being called repeatedly for a period of time

Just now, Xiao Wencheng encountered a problem. When he quickly clicked on the cell, several interfaces were launched. My brother added these 2 lines in his click method

                [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(requstRootDataSourceforFileDircevory:) object:models.fileDirId];
                [self performSelector:@selector(requstRootDataSourceforFileDircevory:) withObject:models.fileDirId afterDelay:0.3];
The effect is awesome

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324728741&siteId=291194637