I am trying to instantiate an NSDirectoryEnumerator from a NSFileManager like this
NSDirectoryEnumerator *enum = [fm enumeratorAtURL:*url includingPropertiesForKeys:nil options:nil errorHandler:nil];
and Xcode keeps coming with an error message that even after reading the complete FileManager and DirectoryManager Documentation doesn’t make any sense to me:
Expected identifier or ‘(‘
Do I have to import anything else than Core Foundation to use NSDirectoryEnumerator or is there some special trick to the usage syntax that I am missing?
// edit:
url is of course a valid NSURL. Just in case this might come up.
In C and, by extension, Objective-C,
enumis a keyword. Change the variable name.Also, you need to remove the asterisk, unless it’s a pointer to
NSURL *(i.e.NSURL **) as commented by @WTP:And the options parameters should be 0, not
nilas noted by @omz.