【发布时间】:2012-11-07 09:26:07
【问题描述】:
我正在使用 simbl 插件在查找器中添加叠加图标,如下所示:finder overlay icon
问题是:我在覆盖函数中找不到正确的方法来获取文件的完整路径:IKImageBrowserCell 中的FO_drawImage,我只得到一个标题。
- (void)FO_drawImage:(id)fp8
{
NSString *title = [self previewItemTitle];
if ([[title lowercaseString] hasPrefix:@"a"])
{
NSImage *icon = [fp8 _nsImage];
NSRect frame = [self imageFrame];
NSLog(@"drawing width %.0f for name '%@' icon %@",frame.size.width,title,icon);
[icon lockFocus];
CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);
CGContextFillEllipseInRect(myContext, CGRectMake (0, 0, 10, 10 ));
[icon unlockFocus];
[self FO_drawImage:[[[IKImageWrapper alloc] initWithNSImage:icon] autorelease]];
} else {
[self FO_drawImage:fp8];
}
}
【问题讨论】:
-
当我使用 IKImageWrapper 时,我的 xcode 给我信息 "(null): "_OBJC_CLASS_$_IKImageWrapper",引用自:"我想知道为什么?
标签: icons overlay finder simbl