objective-c - 头文件中出现AppDelegate.h file not found错误?
问题描述
当我将目标 c 头文件桥接到 swift 项目时。但是在头文件中,我收到了错误,例如AppDelegate.h
找不到文件,也没有在 swift 中调用头函数ViewController
。谁能帮我解决以下错误。
//objective c header file:
#import <UIKit/UIKit.h>
#define UNIVERSAL_RESPONDER UIResponder <UIApplicationDelegate>
#define UNIVERSAL_WINDOW UIWindow
#define UNIVERSAL_APPLICATION UIApplication
#define UNIVERSAL_VIEWCONTROLLER UIViewController
#define UNIVERSAL_TEXTVIEW UITextView
#define UNIVERSAL_BUTTON UIButton
#define UNIVERSAL_VIEW UIView
#define UNIVERSAL_APP_ARGV char *
#define UNIVERSAL_APP_MAIN(__argc, __argv, __class) \
UIApplicationMain(__argc, __argv, nil, __class)
#define UNIVERSAL_TEXTVIEW_SETTEXT(__textView, __text) \
__textView.text = text
#define UNIVERSAL_BUTTON_SETCHECKED(__buttonView, __checked) \
[__buttonView setSelected: __checked]
#define UNIVERSAL_BUTTON_GETCHECKED(__buttonView) \
__buttonView.selected
#endif
#import <Foundation/Foundation.h>
#import <SpeechSDK/SpeechRecognitionService.h>
//have to call in swift like this
UNIVERSAL_BUTTON* buttonSel = (UNIVERSAL_BUTTON*)self.buttonGroup[i];
UNIVERSAL_BUTTON_SETCHECKED(buttonSel, (index == i) ? TRUE : FALSE);
解决方案
推荐阅读
- python - Django 数组字段外键
- c# - Can we control the [Setup] method execution before [Test] Method Execution in Selenium N unit
- c++ - Copy trivially copyable types using temporary storage areas: is it allowed?
- java - Android Studio 应用程序可以运行,但有时在其他设备上会出错
- javascript - FlatList converting single item to an array
- java - How to avoid if statements java7 or make code more readable
- xml - 有效的 XML 字符
- android-studio - 使用wikiitude在android studio上创建一个应用程序,但是它在启动时不断崩溃
- build - How to generate files using dart source_gen to a different directory
- android - ListView 不会呈现结果,但 for 循环会