Errors when trying to play sounds on pg 453


#1

I’m stuck in the Playing system sounds section on page 453. I get two errors, and I can’t figure out why.

These are the errors that I get when I try to run the application:
Undefined symbols for architecture i386:
"_AudioServicesCreateSystemSoundID", referenced from:
-[MediaPlayerViewController init] in MediaPlayerViewController.o
"_AudioServicesPlaySystemSound", referenced from:
-[MediaPlayerViewController playShortSound:] in MediaPlayerViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

Any ideas?


#2

I found the problem. I missed the line that said “Add the AudioToolbox Framework to your project…”. I imported it into MediaPlayerViewController.h but didn’t think to add the framework separately. Now it works.