Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 542223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:25:27+00:00 2026-05-13T10:25:27+00:00

One thing I’ve learned at engineering school is to always to intense validation of

  • 0

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.

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,

       //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, &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];

I have all of the above code in the

- (void)textFieldDidEndEditing:(UITextField *)textField

method.

Here is the errors I get when I try to run it
http://screencast.com/t/Nzc5NDdhMmI

Any help would be greatly appreciated. Not sure what I’m doing wrong since I’m pasting this code directly from another source online.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:25:27+00:00Added an answer on May 13, 2026 at 10:25 am

    I’ve never used the Sound Services, but it looks like you need to import the AudioToolbox framework.

    #import <AudioToolbox/AudioToolbox.h>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One thing that's always confused me is input escaping and whether or not you're
One thing that always bugged me, is that I do not see the base
One thing that's always confused me is how a BackgroundWorker seems to have thread-safe
one thing that i always wondered, if i have a method like this: String
One thing that always strikes me as a non-cryptographer: Why is it so important
One thing I've always wondered about is if the instances of std::string that I
One thing that bothers me about nHibernate is that it is not 100% compile
One thing that really bothers me about Google Code is that fact that it
One thing that's bothered me with vi is that paste (p) inserts lines after
One thing that seems particularly easy to do in the Flash IDE but difficult

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.