我正在使用simbl插件在finder中添加覆盖图标,如下所示:finder overlay icon
问题是:我无法在override function中找到正确的方法来获取文件的完整路径: 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];
}
}发布于 2013-03-06 06:23:15
NSURL *item_url = [self previewItemURL];这应该涵盖了MacOSX 10.7上的内容
https://stackoverflow.com/questions/13266703
复制相似问题