This is NSObject.LoadImage.m in view mode; [Download] [Up]
#pragma .h #import <Foundation/NSObject.h> #pragma .h #import <Foundation/NSString.h> #pragma .h #import <AppKit/NSImage.h> #import "NSObject.LoadImage.h" @implementation NSObject(LoadImage) + (NSImage *)loadImageFromBundle:(NSString *)imageName { id image = nil; id bundle = [NSBundle bundleForClass:self]; NSString *path; if(path = [bundle pathForResource:imageName ofType:@"tiff"]) { image = [[NSImage alloc] initWithContentsOfFile:path]; [image setName:imageName]; } return image; } - (NSImage *)loadImageFromBundle:(NSString *)imageName { return [[self class] loadImageFromBundle:(NSString *)imageName]; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.