iconForFile
iconForFile
- Subject: iconForFile
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 31 Jul 2006 23:08:15 +0200
This works fine:
NSString *ff = [ someWindow representedFilename ] ;
NSImage *icon = [ [ NSWorkspace sharedWorkspace ] iconForFile: ff ];
For unsaved documents the representedFilename is an empty string, and
iconForFile: returns a nice default icon.
But in this case (empty string) I also get a log message: "...Path
given to -[NSWorkspace iconForFile:] is not a full path."
This message correct and all according to documentation. But I don't
want it.
So: how do I get the default document icon without a log message?
Currently I am using this rather clumsy work-around:
if ( ![ ff isAbsolutePath ] ) ff = [ [ NSBundle mainBundle ]
pathForResource: @"Info" ofType: @"plist" ];
But what if plist gets its own icon?
Clearly there must be a better way.
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden