Re: Question about Outline View code in Documentation
Re: Question about Outline View code in Documentation
- Subject: Re: Question about Outline View code in Documentation
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 6 Feb 2004 20:31:43 -0800
On Feb 6, 2004, at 8:15 PM, James McConnell wrote:
I think I can work with that, thanks! I can get the home directory,
then
append "/Documents/Folder". Any clue as to how I can get it not to
show
hidden, "." files?
Umm,
- (NSArray *)children {
if (children == NULL) {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *fullPath = [self fullPath];
BOOL isDir, valid = [fileManager fileExistsAtPath:fullPath
isDirectory:&isDir];
if (valid && isDir) {
NSArray *array = [fileManager
directoryContentsAtPath:fullPath];
int cnt, numChildren = [array count];
children = [[NSMutableArray alloc]
initWithCapacity:numChildren];
for (cnt = 0; cnt < numChildren; cnt++) {
NSString *path = [array objectAtIndex:cnt];
if (![path hasPrefix:@"."])
{
[children addObject:[[FileSystemItem alloc] initWithPath:path
parent:self]];
}
}
} else {
children = IsALeafNode;
}
}
return children;
}
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.