ftp.nice.ch/Attic/openStep/tools/workspace/TheShelf.0.3.3.sd.tgz#/TheShelf.0.3.3.sd/Source/NSImage_MiscExtensions.rtf

This is NSImage_MiscExtensions.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1997, All Rights Reserved.  

pard s0 li2116 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 fs28 fs16 
fs28 
fs16 
fs28 pard s5 li2116 fi0 ri1007 ql f0 b fs56 NSImage 
fs16 





fs56 pard s17 li4888 fi-2771 ri1007 ql tx4888 f1 b0 fs28 fs16 fs28 f0 b fs28 Category Name:	b0 fs28 f1 MiscExtensions
fs16 s10 fs16 fs28 f0 b fs28 Declared In:	b0 fs28 f1 NSImage_MiscExtensions.h
fs16 
fs28 pard s13 li1360 fi0 ri1007 ql f0 b fs36 fs16 




fs36 Category Description
fs16  pard s0 li2116 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs28 fs16 fs28 This category adds methods which help loading images.  Remember that in order to find an image faster you can ,or even should, assign it a name via b setName:b0 .
fs16 
fs28 fs16 fs28 b NOTE:b0  The regular b imageNamed:b0  has a bug since loading a name named "MyImage.tiff" assigns it the name "MyImage"...but on the next request it will not try to find the "MyImage" image.  This cases you code to leak all the images since tehy are still included into the internal table.
fs16 
fs28 fs16 fs28 It remains to be seen if Apple fixes b imageNamed:b0 .  In the mean time you can use our methods since they already include a workaround for that problem.
fs28s13 li1360 fi0 ri1007 ql f0 b fs36 fs16 




fs36 Method Types
fs16  f1 b0 fs28 s35 li6148 fi-4031 ri1007 ql tx6148 tx9676 tx10180 fs16  fs28 Bundle aware image loading 	+ imageNamed:inContext:
pard s34 li6652 fi-503 ri1007 ql tx9676 tx10180 + imageNamed:inContext:searchAllBundles:
pard s13 li1360 fi0 ri1007 ql f0 b fs36 fs16 




fs36 Class Methods
fs16  fs36 s21 li2493 fi-1132 fi-376 fs28 fs16 fs29 b imageNamed:inContext:
s20 li3249 fi-1132 fi-756 f1 b0 fs28 + (id)b imageNamed:b0 (NSString *)i namei0 b  inContext:b0 (id)i objecti0 b b0 
pard s0 li2116 fi0 ri1007 ql tx2494 tx2872 tx3250 fs16 
fs28 Just calls b imageNamed:inContext:searchAllBundles:b0  with a search applied to all bundles and frameworks. 
fs16 
fs28 pard s19 li2493 fi-376 ri1007 ql f0 fs28 fs16 


fs29 b imageNamed:inContext:searchAllBundles:
s20 li3249 fi-1132 fi-756 f1 b0 fs28 + (id)b imageNamed:b0 (NSString *)i namei0 b  inContext:b0 (id)i objecti0 b  searchAllBundles:b0 (BOOL)i flagi0 b b0 
pard s0 li2116 fi0 ri1007 ql tx2494 tx2872 tx3250 fs16 
fs28 We first ask b imageNamed:b0  if it already knows about an image with the specified i namei0 .  If there is no image the search continues in the context of i objecti0 .  In the case where i objecti0  is a normal instance we frist check the bundle where i objecti0  came from.  In the case of i objecti0  being an instance of NSBundle we first check that bundle.  Only pass in the i namei0  of an image following the same rules as for the b imageNamed:b0  method.  Never use a complete path since the purpose is to find a path for an image.
fs16 
fs28 fs16 fs28 b HACK:b0  The following is not yet implemented since we need some more code for the NSBundle class.
fs16 
fs28 fs16 fs28 If that still doesn't help we will go out and try to check with all bundles and all frameworks which have been registered up to now. 
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.