title: iOS background audio linker error
body: <p>error;</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>code i am using:</p>
  
  <pre><code>- (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:&amp;sessionError];
  
      /* Pick any one of them */
      // 1. Overriding the output audio route
      //UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
      //AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(audioRouteOverride), &amp;audioRouteOverride);
  
      // 2. Changing the default output audio route
      UInt32 doChangeDefaultRoute = 1;
      AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &amp;doChangeDefaultRoute);
  
      [self.window addSubview:rootController.view];
      [self.window makeKeyAndVisible];
  
      return YES;
  }
  </code></pre>
  
  <p>(from <a href="https://devforums.apple.com/thread/90684?start=0&amp;tstart=0" rel="nofollow noreferrer">https://devforums.apple.com/thread/90684?start=0&amp;tstart=0</a> and <a href="https://stackoverflow.com/questions/8397223/this-app-was-developed-and-works-fine-under-ios-5-0-but-crashes-under-ios-4-3">this app was developed and works fine under ios 5.0, but crashes under ios 4.3</a> and <a href="https://stackoverflow.com/questions/4771105/how-do-i-get-my-avplayer-to-play-while-app-is-in-background">How do I get my AVPlayer to play while app is in background?</a>)</p>
  
  <p>finally my plist:</p>
  
  <p><img src="https://i.stack.imgur.com/ukxx3.png" alt="enter image description here">
  what is the issue? in my header of appdelegate: </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;AudioToolbox/AudioToolbox.h&gt;
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate, AVAudioPlayerDelegate&gt; {
  
  }
  </code></pre>
  
  <p>seems that everything is imported. What am I doing incorrectly?</p>