Trying to add a Vibrate and Sound to my Alert View
<p>One thing I've learned at engineering school is to always to intense validation of input. I think it's great that with the iPhone SDK you can create a sound and a vibrate option. I would like to put both of these into my Alert View, which shows when the user doesn't fill in a field correctly.</p>

<p>However, I'm getting a ton of errors. Is it not possible to put the vibrate and sound options within an alert view? Here is the code I am using below,</p>

<pre><code>       //create vibrate 
        AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

        //play sound
    SystemSoundID pmph;
    id sndpath = [[NSBundle mainBundle] 
                  pathForResource:@"mySound" 
                  ofType:@"wav" 
                  inDirectory:@"/"];
    CFURLRef baseURL = (CFURLRef) [[NSURL alloc] initFileURLWithPath:sndpath];
    AudioServicesCreateSystemSoundID (baseURL, &amp;pmph);
    AudioServicesPlaySystemSound(pmph); 
    [baseURL release];

        //show alert view
    UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:@"Age Error"
                          message:@"Your age must be at least 40 years old and less than 100 years old"
                          delegate:nil
                          cancelButtonTitle:@"OK"
                          otherButtonTitles:nil];
    [alert show];
    [alert release];
</code></pre>

<p>I have all of the above code in the </p>

<pre><code>- (void)textFieldDidEndEditing:(UITextField *)textField
</code></pre>

<p>method.</p>

<p>Here is the errors I get when I try to run it
<a href="http://screencast.com/t/Nzc5NDdhMmI" rel="nofollow">http://screencast.com/t/Nzc5NDdhMmI</a></p>

<p>Any help would be greatly appreciated. Not sure what I'm doing wrong since I'm pasting this code directly from another source online.</p>
