Possible Duplicate:
Making the iPhone vibrate
I have two buttons. One button adds up, one button adds down. The question is when I certain number such as lets say 22 is in the text area, the phone vibrates for a certain mount of time. Here is my code for it:
What I am trying to say is IF Label Displays "22" THEN VIBRATE PHONE... The question is how do i go about writing this.. I'm still learning so any help regarding this would be much appreciated! Here is my code so far:
#import "StartCountViewController.h"
#import "AudioToolbox/AudioServices.h"
@implementation StartCountViewController
int Count=0;
-(void)awakeFromNib {
    startCount.text = @"0";
}
- (IBAction)addNumber {
    if(Count >= 999) return;
    NSString *numValue = [[NSString alloc] initWithFormat:@"%d", Count++];
    startCount.text = numValue;
    [numValue release];
}
- (IBAction)vibrate {
}
- (IBAction)subtractNumber {
    if(Count <= -35) return;
    NSString *numValue = [[NSString alloc] initWithFormat:@"%d", Count--];
    startCount.text = numValue;
    [numValue release]; 
}
- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}
- (void)dealloc {
    [super dealloc];
}
@end
 
     
    