Documentation tweaks.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21027 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-04-01 10:57:35 +00:00
parent 9fbaca5320
commit 304fce01db
4 changed files with 25 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2005-04-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundle.m: Minor debug/warning log tweaks.
* Headers/Foundation/NSBundle.h: Document differences between GNUstep
and MacOS-X when initialising using a relative path.
* Headers/NSString.h: Fix typo in comment.
2005-03-31 Adam Fedor <fedor@gnu.org> 2005-03-31 Adam Fedor <fedor@gnu.org>
* ANNOUNCE, NEWS, Documentation/news.texi, * ANNOUNCE, NEWS, Documentation/news.texi,

View file

@ -171,11 +171,21 @@ GS_EXPORT NSString* const NSLoadedClasses;
withVersion: (int)version; withVersion: (int)version;
/** <init /> /** <init />
* Init the bundle for reading resources from path. path must be an * Init the bundle for reading resources from path.<br />
* absolute path to a directory on disk. If path is nil or doesn't * The MacOS-X documentation says that the path must be a full path to
* exist, initWithPath: returns nil. If a bundle for that path * a directory on disk. However, it (in MacOS-X) version 10.3 at least)
* already existed, it is returned in place of the receiver (and the * actually accepts relative paths too.<br />
* receiver is deallocated). * The GNUstep behavior is similar in that it accepts a relative path,
* but GNUstep converts it to an absolute path by referring to the
* current working directory when the is initialised, so an absolute
* path is then used and a warning message is printed.<br />
* On MacOS-X using a bundle initialised with a relative path will cause
* a crash if the current working directory is changed between the point
* at which the bundle was initialised and that at which it is used.<br />
* If path is nil or can't be accessed, initWithPath: reallocates the
* receiver and returns nil.<br />
* If a bundle for that path already existed, it is returned in place
* of the receiver (and the receiver is deallocated).
*/ */
- (id) initWithPath: (NSString*)path; - (id) initWithPath: (NSString*)path;

View file

@ -461,7 +461,7 @@ enum {
* @"//host/share/file" produces @"//host/share/" * @"//host/share/file" produces @"//host/share/"
* @"//host/share/" produces @"/host/share/" * @"//host/share/" produces @"/host/share/"
* @"//host/share" produces @"/host/share" * @"//host/share" produces @"/host/share"
* <example> * </example>
*/ */
- (NSString*) stringByDeletingLastPathComponent; - (NSString*) stringByDeletingLastPathComponent;

View file

@ -895,13 +895,13 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
if (!path || [path length] == 0) if (!path || [path length] == 0)
{ {
NSLog(@"No path specified for bundle"); NSDebugMLog(@"No path specified for bundle");
[self dealloc]; [self dealloc];
return nil; return nil;
} }
if ([path isAbsolutePath] == NO) if ([path isAbsolutePath] == NO)
{ {
NSLog(@"WARNING: NSBundle -initWithPath: requires absolute path names!"); NSWarnMLog(@"NSBundle -initWithPath: requires absolute path names!");
path = [[[NSFileManager defaultManager] currentDirectoryPath] path = [[[NSFileManager defaultManager] currentDirectoryPath]
stringByAppendingPathComponent: path]; stringByAppendingPathComponent: path];
} }