【问题标题】:How to create AppDelegate to Third party Framework bridge file如何创建 AppDelegate 到第三方框架桥文件
【发布时间】:2018-02-16 05:06:03
【问题描述】:

我有一个用 Objective C 编写的项目,新功能是用 Swift 3.1 编写的 我的要求是访问在 AppDelegate.h 文件中声明的变量。所以我在我的桥文件中导入 AppDelegate。现在我可以在我的 Swift 类文件中声明 Appdelegate 对象,还可以访问在 Appdelegate 中声明的变量。

问题是,将AppDelegate导入Bridge文件后,AppDelegate.h文件中导入的框架有错误。 “文件未找到” 如果我从桥文件中删除 AppDelegate.h,它的工作正常。

感谢您的帮助

#import <UIKit/UIKit.h>
#import "DCPathButton.h"    <- ERROR IN THIS FRAMEWORK
#import <CoreLocation/CoreLocation.h>



@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property NSInteger addUserFlag;
@property NSInteger addDeviceFlag;
@property NSInteger userProfileFlag;
@property NSInteger backToAddHomeFlag;
@property (strong, nonatomic) NSArray *loginResponseArray;
@property NSInteger AcFlag;
@property (strong,nonatomic) NSDictionary *FCM_Dict;
@property (strong,nonatomic) NSString *supportPhone;
@property (strong,nonatomic) NSString *FCM_Key;
@property DCPathButton *dcPathButtonInAppDelgt;
@property  (strong,nonatomic) NSString *disableAddHomeBtn;
@property  (strong,nonatomic) NSString *disableAddRoomBtn;
@property  (strong,nonatomic) NSString *disableAddDeviceBtn;
@property  (strong,nonatomic) NSString *disableAddUserBtn;
@property (strong,nonatomic) NSString *sideMenuFlag;
@property (nonatomic, strong) CLLocationManager *locationManager;
@property NSInteger homeOrAwayFlag;
@end

【问题讨论】:

    标签: ios objective-c swift3 cocoapods appdelegate


    【解决方案1】:

    #import "DCPathButton.h" 移动到您的 AppDelegate.m 并将其添加到 .h 中:@class DCPathButton;

    【讨论】:

      猜你喜欢
      • 2013-04-09
      • 2017-02-23
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      • 2013-10-20
      • 2014-06-21
      • 1970-01-01
      相关资源
      最近更新 更多