I have an array :
//current array
NSMutableArray *arrayCurrentArray;
//and index indexCurrentPage = 1;
the array needs to be initialized at run-time like this:
arrayCurrentArray =
[[NSMutableArray alloc]
initWithArray:arrayBrotherPirateEnglish
copyItems:YES];
this is how the array is initialized:
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",
@"OBTP English p7", @"OBTP English p8", @"OBTP English p9", @"OBTP English p10",
@"OBTP English p11",
nil];
I then have code like this:
indexCurrentPage++;
if(indexCurrentPage <= [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];
}
My problem is that I cannot access items within the array.
This is the error I am getting:
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: (
Any insight appreciated.