One Quickie


Getting directory listing based on URL (NSFIleManager->General)
    NSURL *mediaDirectory = ...;

    NSArray *contents = [fm contentsOfDirectoryAtURL: mediaDirectory
                            includingPropertiesForKeys: @[]
                            options: 0
                            error: &error];

    if (contents == nil) {
        NSLog (@"could not contents of %@ - %@", mediaDirectory, error);
        return nil;
    }
There's also enumeratorAtURL:includingPropertiesForKeys:... that gives you back a directory enumerator.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com