What about your "files" collection? Are you sure it is still valid AND mutable on the second invocation?

Peter


   NSString* directory = nil;
   NSFileManager* fileManager = nil;
   NSDirectoryEnumerator* walker = nil

directory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
   if(directory == nil)
       /* handle error and exit */

   // fileManager = [NSFileManager defaultManager];
   fileManager = [[NSFileManager alloc] init];
   if(fileManager == nil)
       /* handle error and exit */

   walker = [fileManager enumeratorAtPath:directory];
   if(walker == nil)
       /* handle error and exit */

   NSString* file = nil;
   while((file = [walker nextObject]) != nil)
   {
       BOOL isDirectory = YES;
       if([fileManager fileExistsAtPath:file
isDirectory:&isDirectory] && !isDirectory)
           [files addObject:file];
   }

   ...

   [fileManager release];
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to