objective-c - 在 C 类中导入 OBJ-C 变量
问题描述
我有一个我无法解决的问题。我必须在我的 .c 类中使用在目标 C 文件头中声明的变量。为此,我在 .c 文件中使用此代码:
#ifdef __OBJC__
#import "RilieviTableViewController.h"
#endif
但是当我尝试使用该对象时,xcode 说我“使用了未声明的标识符 semBtnPressed”。在我的 obj C 头文件中,我以这种方式声明了该对象:
#import <UIKit/UIKit.h>
#include <AudioToolBox/AudioToolBox.h>
#include "starrec_pal_sema.h"
static id refToSelf;
static StarRec_PAL_Sema *semBtnPressed; // <-- variable i want to import.
@interface RilieviTableViewController : UITableViewController
// other variable that i don't have to import.
@end
该项目使用 Nuance 库,并且该对象是 Nuance 对象。在示例中,他们只是在 ifdef 块中导入类,但在我的情况下它不起作用。每个人都可以有解决方案吗?
解决方案
推荐阅读
- spring - 在 Spring Kafka 中设置isolation.level = read_committed(Spring Boot 版本 1.5.18 和 spring Kafka 版本 1.3.8)
- algorithm - 用于存储预先计算的最大值的高效数据结构
- powershell - 调用 Web 服务如何添加参数
- angular - 正常订阅函数声明的函数替换错误
- haskell - Haskell:为什么“id”使这个函数不再是单子的?
- java - 如何创建数据集的数组或集合
spark-dataframes 类型的?
- javascript - 如何使用 lodash 或 javascript 匹配两个对象?
- cypress - 如何在不使用元素索引的情况下搜索某个父元素下的特定元素
- mysql - SQL:根据具有共同值的单元格对返回行
- css - 如何将垂直下拉菜单更改为水平下拉菜单