Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wrjohns

macrumors newbie
Original poster
May 4, 2009
9
0
I'm trying to add an AVAudioPlayer class object, which is defined in the AVfoundation framework. When I try to add an existing framework to the Xcode project, AVfoundation isn't one of the choices.

If I use Finder to look for the file, I have 6 of them, in directories like

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/Frameworks/AVfoundation.framework

There's a similar entry for 2.2.sdk, and 3.0.sdk, for both iPhoneSimulator, as well as iPhoneOS.

I'm leery about adding one of these manually, since I don't want to have to manually replace it everytime I switch sdk's.
 
Open the FrameWorks group in your project. Right click on UIKit.framework and choose Reveal in Finder. Choose the AVAudioPlayer.framework from the Finder window that appears and add that one to your project.

When you switch SDKs it should work correctly. Look at the Get Info window for the frameworks in your project that work and this new one. The settings should be the same.
 
Thanks. Got it working.

Noticed a little bit after I posted that the only frameworks showing up were Mac OS ones, and no iPhone ones. Strange that Xcode doesn't point you to the right directory, but ok.
 
Here's a better way to ensure you get the iPhone frameworks:
  • Get Info on your application target
  • In the General tab, click on the '+' button at the bottom to add a Linked Library
  • Pick your desired framework and click the Add button
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.