いくつかのリモートPDFを読みたいのでNSArray
、URLを含むを作成しますが、読み込もうとすると次のようになります:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 2 beyond bounds [0 .. 0]'
これは私のコードです
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([[segue identifier] isEqualToString:@"CircularDetail"]) {
CircularDetailViewController *circulardetail = [self.storyboard instantiateViewControllerWithIdentifier:@"CircularControllerDetail"];
NSIndexPath *myIndexPath = [self.tableView indexPathForSelectedRow];
int row = [myIndexPath row];
circulardetail.DetailModal = [NSArray arrayWithObjects:_SeccionCirculares[row], _circularfecha[row], _circularTitulo[row], _circularURL[row], nil];
[self presentViewController:circulardetail animated:YES completion:nil];
}
}
詳細に私はこれを持っています
- (void) loadRemotePdf
{
NSURL *myUrl = [NSURL URLWithString:[_DetailModal objectAtIndex:3]];
NSURLRequest *myRequest = [NSURLRequest requestWithURL:myUrl];
[self.webview loadRequest:myRequest];
}