エラー;
undefined symbols for architecture i386:
"_AudioSessionSetProperty", referenced from:
-[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
私が使用しているコード:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Set AudioSession
NSError *sessionError = nil;
[[AVAudioSession sharedInstance] setDelegate:self];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&sessionError];
/* Pick any one of them */
// 1. Overriding the output audio route
//UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
//AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(audioRouteOverride), &audioRouteOverride);
// 2. Changing the default output audio route
UInt32 doChangeDefaultRoute = 1;
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &doChangeDefaultRoute);
[self.window addSubview:rootController.view];
[self.window makeKeyAndVisible];
return YES;
}
( https://devforums.apple.com/thread/90684?start=0&tstart=0から。このアプリは開発され、ios 5.0 で正常に動作しますが、ios 4.3でクラッシュし、アプリの実行中に AVPlayer を再生するにはどうすればよいですか?バックグラウンドで?)
最後に私のplist:
どうした?私のappdelegateのヘッダーに:
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioToolbox.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, AVAudioPlayerDelegate> {
}
すべて輸入されているようです。私は間違って何をしていますか?