我正在尝试为 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”。查看此链接<如何编写 OS X Finder 插件> 我发现生成 Finder.h 文件是必需的...
我的问题是:如何生成这个文件?我尝试运行“class-dump -H Finder.app”,但编译错误太多
非常感谢你!