• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
directoryContentsAtPath freezing computer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: directoryContentsAtPath freezing computer
      • From: Kevin Wojniak <email@hidden>
  • Prev by Date: Re: Localizable string and Swedish characters
  • Next by Date: Re: Crash on NSMenu
  • Previous by thread: ANNOUNCE: Renaissance 0.8.0
  • Next by thread: Re: directoryContentsAtPath freezing computer
  • Index(es):
    • Date
    • Thread