我正在尝试创建这样的头文件:
#import <UIKit/UIKit.h>
typedef void (^RevealBlock)();
@interface BFTasksViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate> {
@private
RevealBlock _revealBlock;
}
- (id)initWithTitle:(NSString *)title withRevealBlock:(RevealBlock)revealBlock;
@end
但是我收到这个警告:
Redefinition of typedef 'RevealBlock' is a C11 feature
这有什么值得担心的吗?我在看GHSidebarNav project ,这似乎很好用。
最佳答案
您必须在其他地方声明了 RevealBlock
,因为我没有看到除 UIKit/UIKit.h 之外的任何导入,请检查您的项目 .pch
文件是否存在冲突的 header (或者可能是您删除了一些标题以使代码段更短?)。
关于objective-c - typedef 的重新定义是 C11 的一个特性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12358778/