I have initialize NSMutableArray in viewDidLoad like
playUrl = [[NSMutableArray alloc]init];
But when we use in cellForRowAtIndexPath
[playUrl insertObject:[NSString stringWithFormat:@"%@",_urlToLoad] atIndex:indexPath.row];
Then it will be show this error
2016-11-21 18:06:14.481 TraidingWins[13917:238534] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 1 beyond bounds for empty array'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106348d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105dbcdeb objc_exception_throw + 48
2 CoreFoundation 0x0000000106209cc5 -[__NSArrayM insertObject:atIndex:] + 901
3 TraidingWins 0x0000000102dc7bd6 __45-[YouTubeVC tableView:cellForRowAtIndexPath:]_block_invoke_2 + 902
4 TraidingWins 0x0000000102dbb840 __58+[HCYoutubeParser h264videosWithYoutubeURL:completeBlock:]_block_invoke_2 + 48
5 libdispatch.dylib 0x000000010705fd9d _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x00000001070803eb _dispatch_client_callout + 8
7 libdispatch.dylib 0x00000001070681ef _dispatch_main_queue_callback_4CF + 1738
8 CoreFoundation 0x00000001062a20f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
9 CoreFoundation 0x0000000106263b99 __CFRunLoopRun + 2073
10 CoreFoundation 0x00000001062630f8 CFRunLoopRunSpecific + 488
11 GraphicsServices 0x00000001087f5ad2 GSEventRunModal + 161
12 UIKit 0x0000000104435f09 UIApplicationMain + 171
13 TraidingWins 0x0000000102dcba8f main + 111
14 libdyld.dylib 0x00000001070b492d start + 1
15 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Can anybody help me for solving the crashing issues..