I have not found a very easy way to do this. All the timers and accessories I need to see are all the way. Is there any easy way to hold a UIButton and it causes it to repeat it and to repeat it?
You can do the following: Make an NSTimer that will appear when the app is started or viewdream in more Even boolean will do
For example:
// Announce the required IBActions in timer, bullion and interface. @ Interface classname {NSTimer * timer; Bool ji } - (IBAction) TheTouchDown (ID) sender; - (IBAction) theTouchUpInside (id) this; - (IBAction) theTouchUpOutside (ID) this; // Give the Timer Properties @property (nonatomic, retaining) NSTimer * Timer; Now in your implementation file (.m):
// Synchronize Timer @ Syntysize timer; // When your view triggers the timer and boolean - (zero) viewDidload {g = false; Timer = [NSTM Interval with Scheduled Timer: 1.0 Target: Self Selector: @selector (targetMethod :) userInfo: Zero repeats: Yes]; } Now set the IBAction to "touch down" to say bullion right. Then create another account button for "Touch up Inside" and "Touch up Out", assign boolean to false.
For example:
- (IBAction) theTouchDown {g = true; } - (IBAction) theTouchUpInside {g = false; } - (IBAction) theTouchUpOutside {g = false; } Then in that NSTimer method, put the following: (Suppose you have declared a boolean)
- (zero) targetmethod: (id ) Sender {if (g == true) {// This is for "touch and hold"} {// it is for the person's button is closed}} I hope That makes everything simple ... I know that it still uses the timer, but there is no other way.
Comments
Post a Comment