6

When I create an iOS project,and "Build Phases -> Link binary with Libraries", I add the AVFoundation.framework lib and use #import "<AVFoundation/AVFoundation.h>". I get a compilation error:

"AVFoundation/AVFoundation.h file not found".

Here's my code:

#import <UIKit/UIKit.h>
#import "<AVFoundation/AVFoundation.h>"  

How can I resolve this?

Nazik
  • 8,696
  • 27
  • 77
  • 123
explorer
  • 449
  • 2
  • 10
  • 19

3 Answers3

24

Use

#import <AVFoundation/AVFoundation.h>

There is only two types of #import statements:

#import <file.h>

and

#import "file.h"

There is no type like : #import "<file.h>" you are making mistake here: #import "<AVFoundation/AVFoundation.h>"

In general the #import "QuartzCore/QuartzCore.h" form is "find my very own header, if you can't find it look for a system header", and the form is "find a system header". In theory the locations are compiler defined and they could be implemented differently on a given platform, but I haven't run into a C compiler that does anything different.

Reference: SO

Community
  • 1
  • 1
Midhun MP
  • 103,496
  • 31
  • 153
  • 200
9

You have extra quotes.

Use

#import <AVFoundation/AVFoundation.h>

not

#import "<AVFoundation/AVFoundation.h>" 
yeesterbunny
  • 1,847
  • 2
  • 13
  • 17
  • thanks for your answer very much. you correct me. but Midhun MP is a little faster than you, thanks you all the same – explorer Nov 05 '12 at 06:29
1

please do not use

#import "<AVFoundation/AVFoundation.h>"  

use this

#import <AVFoundation/AVFoundation.h>

we can import two type of library

first one is System Library which are developed by Apple developer

are imported as

 #import <Library.h>

Second one is Classes implemented by Application developer

like as

#import "Library.h"
Gajendra Rawat
  • 3,673
  • 2
  • 19
  • 36