RE: Count of enumerator?
RE: Count of enumerator?
- Subject: RE: Count of enumerator?
- From: "Christopher Hickman" <email@hidden>
- Date: Thu, 11 May 2006 11:54:05 -0400
> From: Thilo Ettelt
> Why don't create a remaining objects array yourself using -
> containsObject:, -subarrayWithRange:?
I don't understand what you're suggesting.
> From: John Stiles
> e.g. imagine if you wanted to make an NSEnumerator of the whole file
> system (just for the sake of a simple explanation). With the current
> design, it doesn't need to grab the state of the entire disk when you
> first create it; it only needs to know where it's currently
> pointing in
> the file system hierarchy, and how to find the next thing. If it
> supported -[count], then it would need to count up every file on the
> hard disk all at once.
I'm starting with an NSDirectoryEnumerator, and I just wanted to know how
many objects were in the enumerator so I could provide the user with a
determinate progress indicator. Since it appears that it doesn't know
without actually crawling the directories, I'll probably just scrap that and
use an indeterminate indicator...
> From: Ryan Britton
> If you take a look at UKDirectoryEnumerator at the following
> link, it shows a possible lazy approach this enumerator
> might be similar to (though the NS* version is a lot slower...).
> http://www.zathras.de/angelweb/sourcecode.htm
Thanks for this, there's a lot of code here that looks interesting. I'll
check your enumerator to see if it is better for my needs.
Thanks everyone for the replies.
Topher
_______________________________________________
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