iOS Dropbox API: 在 .h 文件中导入 DropboxSDK/DropboxSDK.h
iOS Dropbox API: Import DropboxSDK/DropboxSDK.h in a .h file
在 .m 文件中导入 DropboxSDK 效果很好,但是当我尝试将其导入 header(以便对其进行子类化)时,每个 .m 文件都会出现 "Parse Issue: Expected a type" 错误。 DropboxSDK 中的 h 文件(DBRestClient、DBRequest 等)
.h 文件:
#ifndef Photo_Voithos_Voithos_h
#define Photo_Voithos_Voithos_h
#endif
#import <Foundation/Foundation.h>
#import <DropboxSDK/DropboxSDK.h>
@interface Voithos : NSObject
@property NSDate *date;
.m (ViewController) 文件
#import "ViewController.h"
#import <DropboxSDK/DropboxSDK.h>
#import "Voithos.h"
@interface ViewController () <DBRestClientDelegate>
@property (nonatomic, strong) DBRestClient *restClient;
@property (nonatomic, strong) Voithos *voithos;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)initiateDropbox {
self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
}
确保将 Security.framework
和 QuartzCore.framework
添加到您正在使用的目标的构建阶段。可能那些都不见了。
在 .m 文件中导入 DropboxSDK 效果很好,但是当我尝试将其导入 header(以便对其进行子类化)时,每个 .m 文件都会出现 "Parse Issue: Expected a type" 错误。 DropboxSDK 中的 h 文件(DBRestClient、DBRequest 等)
.h 文件:
#ifndef Photo_Voithos_Voithos_h
#define Photo_Voithos_Voithos_h
#endif
#import <Foundation/Foundation.h>
#import <DropboxSDK/DropboxSDK.h>
@interface Voithos : NSObject
@property NSDate *date;
.m (ViewController) 文件
#import "ViewController.h"
#import <DropboxSDK/DropboxSDK.h>
#import "Voithos.h"
@interface ViewController () <DBRestClientDelegate>
@property (nonatomic, strong) DBRestClient *restClient;
@property (nonatomic, strong) Voithos *voithos;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)initiateDropbox {
self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
}
确保将 Security.framework
和 QuartzCore.framework
添加到您正在使用的目标的构建阶段。可能那些都不见了。