directoryContentsAtPath freezing computer
directoryContentsAtPath freezing computer
- Subject: directoryContentsAtPath freezing computer
- From: Kevin Wojniak <email@hidden>
- Date: Sun, 7 Dec 2003 15:40:31 -0800
I am using NSFileManager's directoryContentsAtPath to see if files
inside a folder can be initialized through NSAttributedString. However,
when I go through the loop, some folders freeze up the app and
partially the entire computer. For example, if I use the code with the
pat /Documents it works fine - no freezes or anything. But if I try to
do it with the root volume / it will freeze up pretty bad.
I use this in the tableViewSelectionDidChange notification:
NSArray *files = [[NSFileManager defaultManager]
directoryContentsAtPath:p];
int i, count=0;
for (i=0; i<[files count]; i++) {
NSAttributedString *a = [[NSAttributedString alloc] initWithPath:[p
stringByAppendingPathComponent:[files objectAtIndex:i]]
documentAttributes:nil];
if (a) count++;
}
Any ideas why this would freeze the computer for some directories but
not for others?
Thanks,
Kevin
______
Kevin Wojniak
www.kainjow.com
_______________________________________________
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.