iPhone SDK: Copying Array
<p>I have an array :</p>

<pre><code>//current array
NSMutableArray *arrayCurrentArray;
</code></pre>

<p>//and index
    indexCurrentPage = 1;</p>

<p>the array needs to be initialized at run-time like this:</p>

<pre><code>            arrayCurrentArray =
 [[NSMutableArray alloc]
 initWithArray:arrayBrotherPirateEnglish
 copyItems:YES];
</code></pre>

<p>this is how the array is initialized:</p>

<blockquote>
  <p>arrayBrotherPirateEnglish = [NSArray
  arrayWithObjects:@"OBTP English full
  with text", @"OBTP English p1", @"OBTP
  English p2",
                                 @"OBTP English p3", @"OBTP English p4", @"OBTP English p5",
  @"OBTP English p6",<br>
                                 @"OBTP English p7", @"OBTP English p8", @"OBTP English p9",
  @"OBTP English p10",<br>
                                 @"OBTP English p11",<br>
                                nil];</p>
</blockquote>

<p>I then have code like this:</p>

<pre><code>indexCurrentPage++;

if(indexCurrentPage &lt;= [arrayCurrentArray count]) {
    //next page to play             
    strFileName = [arrayCurrentArray objectAtIndex:indexCurrentPage]; 
    NSLog(@"next page filename %s ", strFileName);
    //set the player
    NSURL *url = [NSURL URLWithString:strFileName];
    [player setContentURL:url];
    //play
    [player play];      
}
</code></pre>

<p>My problem is that I cannot access items within the array. </p>

<p>This is the error I am getting:</p>

<pre><code>2010-07-26 12:57:18.888 BookReaderJuly23[49638:207] next page filename ‡ûú» 
2010-07-26 12:57:18.890 BookReaderJuly23[49638:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:isDirectory:]: nil string parameter'
2010-07-26 12:57:18.892 BookReaderJuly23[49638:207] Stack: (
</code></pre>

<p>Any insight appreciated.</p>
