在播放音频文件时,使用AVAudioPlayer建立对象时spa
_avPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:mp3URL error:&error];code
报了这个错:对象
Undefined symbols for architecture i386:it
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:io
objc-class-ref in ViewController.oclass
ld: symbol(s) not found for architecture i386import
clang: error: linker command failed with exit code 1 (use -v to see invocation)音频
这是没有找到这个类的错误,但我已经在头文件中#import <AVFoundation/AVFoundation.h>了,为何还报错了?command
后来发现,原来在工程中没有加入AVFoundation.framework库,im
加入了这个库以后在运行就哦了!