| name | language | licence |
|---|---|---|
| Force Application Crash | Objective-C | Other |
| 64-bit Number from a String | Perl | Other |
| FourCharCode to NSString | Objective-C | Other |
| Printing Binary Representation of String | C | Other |
| ROT13 | Objective-C | Other |
| NSIndexSet to String | Objective-C | Other |
| getBoundingClientRect from WebKit using JavaScriptCore | Objective-C | Other |
| NSImage Create QuickLook icon for URL | Objective-C | Other |
< 1 2 3 4 >
language: Objective-C
licence: Other
NSImage Create QuickLook icon for URL
options: view full snippet • send to code collector
#import <QuickLook/QLThumbnailImage.h>
@implementation NSImage (NSImageAdditions)
+(NSImage *) quicklookIconForURL:(NSURL *)url ofSize:(NSSize)aSize iconMode:(BOOL)iconMode
{
NSImage *image = nil;
if( url && [[NSFileManager defaultManager] fileExistsAtPath:[url path]] )
{
CFMutableDictionaryRef options;
if( iconMode )
{
options = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, NULL, NULL );
CFDictionaryAddValue( options, kQLThumbnailOptionIconModeKey, kCFBooleanTrue );



library
objective-c (22)