documentation path?
documentation path?
- Subject: documentation path?
- From: PA <email@hidden>
- Date: Wed, 5 Apr 2006 20:27:31 +0200
Hello,
Is there a reasonable way to programatically discover the location of a
framework documentation?
For example, given a class, I can pretty confidently build a path to
its header:
static NSString* _DefaultHeaderPath = @"Headers";
static NSString* _DefaultHeaderPathExtension = @"h";
NSBundle* aBundle = [NSBundle bundleForClass: [self reference]];
NSString* aPath = [[[[aBundle bundlePath]
stringByAppendingPathComponent: _DefaultHeaderPath]
stringByAppendingPathComponent: [self name]]
stringByAppendingPathExtension: _DefaultHeaderPathExtension];
if ( [[NSFileManager defaultManager] fileExistsAtPath: aPath] == YES )
{
_headerPath = [aPath retain];
}
Not so long time ago, I could try the same approach to discover the
documentation path as well:
static NSString* _DefaultDocumentationPath =
@"English.lproj/Documentation/Reference/ObjC_classic/Classes";
static NSString* _DefaultDocumentationPathExtension = @"html";
static NSString* _DefaultDocumentationNameSuffix = @"ClassCluster";
NSBundle* aBundle = [NSBundle bundleForClass: [self reference]];
NSString* aPath = [[[[aBundle resourcePath]
stringByAppendingPathComponent: _DefaultDocumentationPath]
stringByAppendingPathComponent: [self name]]
stringByAppendingPathExtension: _DefaultDocumentationPathExtension];
if ( [[NSFileManager defaultManager] fileExistsAtPath: aPath] == NO )
{
aPath = [[[[aBundle resourcePath] stringByAppendingPathComponent:
_DefaultDocumentationPath] stringByAppendingPathComponent: [NSString
stringWithFormat: @"%@%@", [self name],
_DefaultDocumentationNameSuffix]] stringByAppendingPathExtension:
_DefaultDocumentationPathExtension];
if ( [[NSFileManager defaultManager] fileExistsAtPath: aPath] == NO
)
{
aPath = nil;
}
}
Unfortunately, today, the documentation seems to have been banned from
the frameworks themselves and relegated to some random location under
/Developer or such.
Is packaging documentations alongside frameworks not in fashion any
more?
Is there an alternative way to discover where the documentation for a
given class could be located?
TIA.
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/
_______________________________________________
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