IBAction fires twice when quickly pressed

I have a weird problem. I have a view that is used to set custom preferences. I have this in my normal share menu, and when I click on the UIButtons inside this scene, they only execute the IBAction callback once. Even when you spam the button. It's good.

Now, in order to make things faster for the user, I am also allowing access to this same ViewController elsewhere. This time, instead of using push animation, I create a ViewController instance myself and show it on top of everything else. For some reason in this context, if I click buttons quickly, IBAction is called multiple times.

This is a problem for me because I have an execute function inside IBAction and it renders the following view twice. So when the user returns it, it goes back to the same view, and if you return it one more time it will crash the application.

I don't know how to solve this problem because the same UIViewController behaves differently in two different contexts ...

I am using xcode 4.5

+3
ios ios6


source to share


No one has answered this question yet

Check out similar questions:

1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
545
IOS app with broken infrastructure on device, dyld: library not loaded, Xcode 6 Beta
4
Firing IBAction UIButton is delayed
1
UIButton @IBAction subclass not working
1
UICollectionView custom cell how to select before start when you click UIButton
0
UIButton does not trigger action if space is between two views
0
UIbutton tap break inside uipageviewcontroller
0
Why can't a single IBAction be associated with a UIButton in the xib file?
0
UIButton Inside Inested ScrollViews is highlighting but not triggering Segue or IBAction when using Tapped - Swift
-1
@IBAction func doesn't work when clicked with UILabel and UIButton



All Articles
Loading...
X
Show
Funny
Dev
Pics