1. global variable flag method
@property (nonatomic,assign) boolisclickedflag;//prevent repeated clicks
#pragma mark--global variable flag method
-(void) ljbtnclicked
{
if (Self.isclickedflag ==yes)
{
Self.isclickedflag =no;
function//own function
{
Do what you need to do, then open click
self.isclickedflag =yes
}
}
2. Delay Call Method
Delay 0.5s to perform
[selfperformselector: @selector (ljbtnclicked) withobject:nilafterdelay:0.5];
Dispatch_after (Dispatch_time (Dispatch_time_now, int64_t) (0.5 * nsec_per_sec)), Dispatch_get_main_queue (), ^{
[Self ljbtnclicked];//Delay execution
}];
3. Class Delay method
You just need to set a property time.
Refer to this article http://www.jianshu.com/p/8e562c24039e
4. Set the Click UI property to No (most effective method)
[_btnnode Setcontrolnodeenable:no];
Dispatch_after (Dispatch_time (Dispatch_time_now, int64_t) (0.5 * nsec_per_sec)), Dispatch_get_main_queue (), ^{
[ Self ljbtnclicked];//delay execution
[_btnnode setcontrolnodeenable:yes];
};