0

我知道要在 iOS 应用程序中使用 FFmpeg,您需要使用 ./configure 和 make 来生成 .a 文件,然后将其添加到项目中。

我的问题是,一旦 .a 文件出现在项目导航器和 Link Binary With Libraries 部分中,你如何在你的类中实际使用它们?,我看到 #import 语句中没有“框架”可以使用,所以我不知道如何访问类的方法和属性。

4

2 回答 2

1

您只需将头文件 (.h) 导入您的实现 (.m) 文件并继续。举个例子 ;

#import "avformat.h"

// Some code goes here

    /*
     *   avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
     */
    int openInputValue = avformat_open_input(&pFormatCtx, utf8FilePath, inputFormat, nil);
    NSLog(@"%s - %d # openInputValue = %d", __PRETTY_FUNCTION__, __LINE__, openInputValue);
于 2015-07-02T07:59:38.247 回答
0

每个.a文件都有一些实现文件,每个实现文件都有一个接口文件,objc-c实现文件是.m/.mm,接口文件是.h,就像C/C++一样,所以如果你想使用这个库,你需要导入头文件(.h)。头文件可以告诉你类的方法和属性

于 2012-04-06T03:06:12.620 回答