Directory listing model I need a class to read and store directory structure. This is my first step in Objective C so I ask to you to say what you think.

Header file:

#import &lt;Foundation/Foundation.h&gt;

@interface FileStructureRepresentation : NSObject

- (id)initWithPath:(NSString *)path;
-(NSMutableDictionary*) parse;

@end


Code:

#import "FileStructureRepresentation.h"

@implementation FileStructureRepresentation

NSFileManager *fileManager = nil;
NSString *startPath;

- (id)initWithPath:(NSString *)path
{
    self = [super init];
    if (self) {
        fileManager = [NSFileManager defaultManager];
        startPath = path;
    }
    return self;
}

-(NSMutableDictionary *) parse {
    return [self parseDirectory:startPath];
}

-(NSMutableDictionary *) parseDirectory:(NSString *)path {
    NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
    NSMutableArray *collectionOfFilesAndDirectories = [[NSMutableArray alloc] init];
    NSError *error = nil;
    NSArray *listOfFiles = [fileManager contentsOfDirectoryAtPath:path error:&amp;error];

    if(error.code != 0) {
        NSLog(@"Error code:%d, Description:%@", error.code, error.description);
    }

    for(NSMutableString *s in listOfFiles) {
        NSString *temporaryPath = [NSString stringWithFormat:@"%@/%@", path, s];
        NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:temporaryPath
                                                                     error:&amp;error];
        NSString *fileType = [fileAttributes valueForKey:NSFileType];
        if([fileType isEqualToString:@"NSFileTypeRegular"])
            [collectionOfFilesAndDirectories addObject:s];
        else
            [collectionOfFilesAndDirectories addObject:[self parseDirectory:temporaryPath]];
    }

    [result setObject:collectionOfFilesAndDirectories forKey:path];

    return result;
}

@end


Example:

FileStructureRepresentation *fileStructure = [[FileStructureRepresentation alloc] initWithPath:@"/Users/demas/temporary/tst"];
NSMutableDictionary *structureModel = [fileStructure parse];
I usually think that a mutable array or dictionary as a return value is a bad thing, unless there is a good reason. By this I mean the promise of the API, not the actual value returned. I don't see a reason that the value returned must be mutable, so if you're not planing to modify the return value often I'd change the return type of parse to NSDictionary (you can still return the mutable dictionary in its implementation, that's OK; if you'd like to feel save do return [result copy];).
Since your class actually only has just one method, and that can be made generic, I'd either turn that method into a class method or turn it into a free function altogether (unless you plan to add more functionality, of course). Like:

@interface FileStructureRepresentation : NSObject
+ (NSDictionary *)fileStructureRepresentationForPath:(NSString *)path;
@end

// or even

NSDictionary *FileStructureRepresentationForPath(NSString *path);

-[NSFileManager contentsOfDirectoryAtPath:error:] returns an array of NSString objects, so it should be for(NSString *s in listOfFiles).
When you detect an error (if(error.code != 0)) you should return. I'd return nil. A better way to check for error here would be if(error != nil) since the error code 0 might be a valid value in certain error domains.
In your if([fileType isEqualToString:@"NSFileTypeRegular"]) block you are not using braces, even though you do use them for if(error.code != 0) (both have only one line bodies). I'd make sure they're consistent, but especially with respect to goto fail I recommend to always use braces unless you have the if and the body on the same line. It's a matter of taste, though.
Instead of [fileAttributes valueForKey:NSFileType] you really want [fileAttributes objectForKey:NSFileType] or even simply fileAttributes[NSFileType]. See Difference between objectForKey and valueForKey?.
This is minor: instead of doing [NSString stringWithFormat:@"%@/%@", path, s] it's more explicit and "correct" to do [path stringByAppendingPathComponent:s].
You're not evaluating and handling the error from your call to [fileManager attributesOfItemAtPath:temporaryPath error:&amp;error];. If you don't plan to, just pass NULL instead of &amp;error. Otherwise, the question is how to react to the error, that's up to you and your requirements: maybe just skip the entry: if (error != nil) { /* Clear error for next iteration. */ error = nil; continue }