setting a NSDocumentDirectory url for recording?
I am setting my url for recording with :

    NSArray *dirPaths;
    NSString *docsDir;
    
    dirPaths = NSSearchPathForDirectoriesInDomains(
                                                   NSDocumentDirectory, NSUserDomainMask, YES);
    docsDir = [dirPaths objectAtIndex:[globals sharedGlobals].folderCounter];
    NSString *soundFilePath = [docsDir
                               stringByAppendingPathComponent:@"sound1.caf"];
    
    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];


when `[globals sharedGlobals].folderCounter` is 0 at the start, and it works.
the next time i record i do it in another index:

    [globals sharedGlobals].folderCounter=[globals sharedGlobals].folderCounter+1;

so in the next time i am  trying to record i get error:

    index 1 beyond bounds [0 .. 0]


but why cant i create a new place for recording ?i want to have 4 folder 1-2-3-4 and record each time in another one.

how would i do that ?

thanks .
setting a NSDocumentDirectory url for recording?
===

I am setting my url for recording with :

    NSArray *dirPaths;
    NSString *docsDir;
    
    dirPaths = NSSearchPathForDirectoriesInDomains(
                                                   NSDocumentDirectory, NSUserDomainMask, YES);
    docsDir = [dirPaths objectAtIndex:[globals sharedGlobals].folderCounter];
    NSString *soundFilePath = [docsDir
                               stringByAppendingPathComponent:@"sound1.caf"];
    
    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];


when `[globals sharedGlobals].folderCounter` is 0 at the start, and it works.
the next time i record i do it in another index:

    [globals sharedGlobals].folderCounter=[globals sharedGlobals].folderCounter+1;

so in the next time i am  trying to record i get error:

    index 1 beyond bounds [0 .. 0]


but why cant i create a new place for recording ?i want to have 4 folder 1-2-3-4 and record each time in another one.

how would i do that ?

thanks .