【发布时间】:2012-09-28 05:17:54
【问题描述】:
我的第一个问题是,如果我使用 opencv 库在 C++ 中编写一个类来检测图像中的任何对象并在 Objective-C(xcode 项目)中调用该 c++ 类,那么这种技术会起作用吗?
和
第二个问题是如何在我的 iphone 应用项目 中添加 c/c++ 类并在我的传统 ViewController 类中使用它。
到现在为止我做的还算不上
:使用一个 ViewController 创建了一个 TabView 应用程序。 :在该 ViewController 中添加了一个按钮。 :添加了一个 File.c 类,它只是打印字符串。 : 在我的 ViewController.h 和 ViewController.m 类中导入“File.c”
我的 ViewController.h 类
#import <UIkit/UIkit.h>
#import "file.c"
我的 ViewController.m 类
#import "FirstViewController.h"
#import "File.c"
现在,在按下按钮时,我想调用我已经添加到项目中的 C 类。 我希望得到好的和有益的答案。
问候
【问题讨论】:
-
@SpencerWong :: 如果我的 c/c++ 类只是在屏幕上打印一行并且我在 ViewController 类中添加了一个按钮,而我想要的只是按下按钮我的 C/C++ 类开始工作。那么该怎么做呢?
标签: c++ objective-c xcode class ios5