how to disable action method on a button click programmatically - iphone

I am developing a simple quiz game in which if a button is clicked then the player can have two chances to give answer. If first choice is right, then buttonClicked action will performed. If it is wrong then player can have second chance to give the answer. if it is correct, buttonClicked will performed otherwise game over.
please guide me how to perform this .. Any help will be highly appreciated..

UIControll has property enabled.
If the enabled state is NO, the control ignores touch events ...

Related

Showing the microphone in iOS5

I am developing for the new iOS 5 and am wondering whether it is possible to automatically turn on the microphone in response to an event like a tap. I know there is a button on the keyboard (at least for the iphone4S) which displays it and allows to switch it on/off. My input will be added to a textfield. So far I can display the keyboard by calling the method becomeFirstResponder on my textfield object but I want to go a step further and directly turn on the microphone. Is it possible? Thanks in advance for your help.
Regards,
Luis

Distinguishing between tapping a button and holding a button down on iPhone

In my app, I have a button that triggers an action. However, I'd like to do the following instead.
If the user taps the button, then trigger tapAction.
If the user holds the button down for, say 1 second (getting a sense of the right length of time here would be great, too), then trigger holdAction instead.
Many standard apps seem to have this capability, so I'm certain it's possible. If you could point me to the right place in the documentation, that would be great.
Thanks.
The answer to this question should cover it. The question talks about UITableViews but the method is the same for any UIView :)
You should take a look at UIGestureRecognizers to see what else is out there.

how to activate the thumb of slider to work as a button?

I want to make the thumb of my slider to work as the button so that when a user done selecting the value and pull his finger up it should do something i want.
Is there any way to do this.
Thanks,
Hi,
Create this function
- (IBAction)mySliderUserFinshed:(UISlider *)theSlider
Make sure you add it to the header of you file.
The in interface builder, right click on the slider you want to act as a button.
You will need to wire up the Sent Event
Touch Up Inside to the function that you created. If you dont know how to use interface builder watch a few quick videos on youtube or in Xcode 4 there is a short guide on some of the new and awesome features of xCode 4 with very very cool videos (takes about 10mins to watch and will save you hours of coding).
Good Luck, John.

iPhone/iPad Flipboard Page Turn Animation?

I want to make an animation that is exactly the same as the Flipboard's one. I have tested Leaves and EPGLTransitionView on github, however, Leaves gives me the hand gesture but doesn't implement the page turn animation (its animation is like the iBook's one), and EPGLTransitionView doesn't implement the hand gestures.
Could anyone help me? Thanks in advance.
Sincerely,
Kai.
This github project might be what you are looking for: https://github.com/Dillion/iOS-Flip-Transform.

UISlider with sound effect and vibration

I need to do a lot of things with UISlider. First of all I want to know what are all the things are possible and what are not. Please give me ideas for the doable ones.
I need to add a slider control in my iPhone application (that should resemble the one which is displayed in the iphone when the phone is getting charged).
Can the round button of the UISlider be changed to any other shape. Can any image be added on top of that round button?
When the UISlider is being moved, we need ad a sound effect(for example car stating sound) and when the sliding ends the sound should be stopped. is this possible? if yes, please gimme ideas to do this. 3. vibration should also happen while sliding (possible?)
Thanks in advance!!!
All of these can be done via the public API. Read the docs :-)
The button is called the "thumb image"; there's a property to replace the image.
Assign a delegate and set the 'continuous' property on the slider.
See the Application Programming Guide for more on delegates.
As far as question number 2, just write up the methods to accomplish playing a sound and vibrating and then have them fire when the value changes on the slider.