title: XCode Linker Error When Running an AVFoundation/AVAudioPlayer framework
body: <p>so im trying out a simple app to play a simple mp3 and for some reason i get the same error no matter what i try.
  it fails to run whenever i include AVFoundation/AVAudioPlayer it crashes on me. but once i remove that framework, it works fine. 
  please help.</p>
  
  <p>this is the error i recieve..</p>
  
  <pre><code>    ld: warning: ignoring file /Users/nnamdiokeke/Desktop/Play/AVFoundation.framework/AVFoundation, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x c 0x 0 0x 0 0x 0 0x 9 0x 0 0x 0 0x 0 0x 6 
  0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Users/nnamdiokeke/Desktop/Play/AVFoundation.framework/AVFoundation
      Undefined symbols for architecture i386:
        "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
            objc-class-ref in ViewController.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>The code is pasted below.</p>
  
  <p>Header File</p>
  
  <pre><code>//
  //  ViewController.h
  //  Play
  //
  //  Created by Nnamdi Okeke on 9/13/12.
  //  Copyright (c) 2012 Nnamdi Okeke. All rights reserved.
  //
  
  #import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVAudioPlayer.h&gt;
  
  @interface ViewController : UIViewController &lt;AVAudioPlayerDelegate&gt; {
  
      AVAudioPlayer *song;
      NSURL *songlink;
  }
  
   @property (nonatomic, retain) AVAudioPlayer *song;
  
  -(IBAction)play:(id)sender;
  
  @end
  </code></pre>
  
  <p>Implementation file</p>
  
  <pre><code>//
  //  ViewController.m
  //  Play
  //
  //  Created by Nnamdi Okeke on 9/13/12.
  //  Copyright (c) 2012 Nnamdi Okeke. All rights reserved.
  //
  
  #import "ViewController.h"
  #import &lt;AVFoundation/AVAudioPlayer.h&gt;
  
  
  @implementation ViewController
  
  
  - (void)viewDidLoad
  {
      songlink = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"A4Hood" ofType:@"mp3"]];
      song = [[AVAudioPlayer alloc] initWithContentsOfURL:songlink error:nil];
      song.delegate = self;
      //[song play];
  
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  -(IBAction)play:(id)sender {
      songlink = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"A4Hood" ofType:@"mp3"]];
      song = [[AVAudioPlayer alloc] initWithContentsOfURL:songlink error:nil];
      song.delegate = self;
      [song play];
  
  
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  }
  
  @end
  </code></pre>