Cocoa开发:文档应用、异常处理与调试指南
1. 文档应用开发:添加混合颜色到GUI
1.1 添加出口到CMDocument.h文件
首先,我们要为每个混合颜色样本添加一个出口到 CMDocument.h 文件。同时,在文件顶部添加 @class 声明,告知编译器 CMColorBlendView 是一个类名,这样可以避免导入类的头文件,提高编译速度并减少头文件之间的依赖。以下是具体代码:
#import <Cocoa/Cocoa.h>
@class CMColorBlendView;
@interface CMDocument : NSPersistentDocument
@property (weak) IBOutlet CMColorBlendView *multiplyBlendView;
@property (weak) IBOutlet CMColorBlendView *screenBlendView;
@property (weak) IBOutlet CMColorBlendView *overlayBlendView;
@property (weak) IBOutlet CMColorBlendView *darkenBlendView;
@property (weak) IBOutlet CMColorBlendView *lightenBlendView;
@property (weak) IBOutlet CMColorBlendView *colorDodgeBlendView;
@pr
超级会员免费看
订阅专栏 解锁全文
39

被折叠的 条评论
为什么被折叠?



