【发布时间】:2012-04-03 10:08:00
【问题描述】:
我正在尝试为 Finder 创建一个 SIMBL 插件,以便在某些文件上添加图标覆盖。
我有这个代码:
@implementation NSObject (FAIconOverlay)
- (void)FAIconOverlay_TIconAndTextCell_drawIconWithFrame:(struct CGRect)arg1
{
[self FAIconOverlay_TIconAndTextCell_drawIconWithFrame:arg1];
if (![self respondsToSelector:@selector(node)]) {
return;
}
NSLog(@"%@", [[[NSClassFromString(@"FINode") nodeWithFENode:[(TNodeIconAndNameCell *)self node]] fullPath] lastPathComponent]);
// Draw the icon overlay
}
- (void)FAIconOverlay_TDesktopIcon_drawIconInContext:(struct CGContext *)arg1
{
[self FAIconOverlay_TDesktopIcon_drawIconInContext:arg1];
}
@end
我可以绘制图标覆盖,但是,当我尝试获取文件的路径时,我得到“使用未声明的标识符 TNodeIconAndNameCell”。看这个链接 How to Write OS X Finder plugin> 我看到生成 Finder.h 文件是必要的......
我的问题是:如何生成这个文件?我尝试运行“class-dump -H Finder.app”,但编译错误太多
非常感谢!
【问题讨论】: