相关疑难解决方法(0)

在Swift中使用obj-c typedef

我有一个typedef如下:

typedef NSString VMVideoCategoryType;

extern VMVideoCategoryType *const VMVideoCategoryType_MusicVideo;
extern VMVideoCategoryType *const VMVideoCategoryType_Audio;
extern VMVideoCategoryType *const VMVideoCategoryType_Performance;
extern VMVideoCategoryType *const VMVideoCategoryType_Lyric;
extern VMVideoCategoryType *const VMVideoCategoryType_Show;
Run Code Online (Sandbox Code Playgroud)

我已将此文件包含在桥接头中.但是,当我尝试访问VMVideoCategoryTypeSwift文件时,我收到一个错误:

Use of undeclared type 'VMVideoCategoryType'

有没有办法让这项工作或我必须在Swift中完全重新定义这种类型?

typedef objective-c swift

8
推荐指数
1
解决办法
1689
查看次数

标签 统计

objective-c ×1

swift ×1

typedef ×1