I just downloaded XCode 3.2.5 with 4.2 ... I'm trying to play an mp3 file, but apparently the UI changed becau开发者_StackOverflow中文版se I wasn't able to follow any of the tutorial instructions on how to add a framework. Finally I clicked on a little gear button then went to Add -> Existing Frameworks... However AVFoundation is not listed so I'm unable to use the following code:
#import <AVFoundation/AVFoundation.h>
AVAudioPlayer *player;
The post is asking for the "missing" AVFoundation framework. It is true that you cannot easily find it though "Add an existing framework" in some SDK versions, e.g. Xcode 3.2.
Here is the easy way to solve it, thanks to some other people who pointed it out in another forum.
- Click on "Target"
- Click on your app
- Get Info
- In the bottom, click on "+"
Now you should be able to see it. I did this and solved the issue.
Right click the frameworks group right Add -> Existing frameworks, a list of frameworks will appear just select AVFoundation framework & click add
- In the "project navigator", open the "frameworks" folder and select one the existing frameworks (e.g. UIKit.framework)
- Right click and select "Show in Finder" from the menu
- From the newly opened folder in the finder, drag the framework folder you are interested in (e.g. OpenGLES.framework) into the "frameworks" folder in XCode
- Be sure not to "copy items into destination's group folder"
- Choosing "Create groups for any added folders" seems to make it
(duplicate from previous question-- just dumped it into this question as well for any one still struggling with it)
精彩评论