Inserting object causing crash on next line "//Crashing".
NSUInteger count=indexPath.row+1;
NSMutableArray *arCells=[NSMutableArray array];
for(NSDictionary *dInner in ar ) {
[arCells addObject:[NSIndexPath indexPathForRow:count inSection:0]];
if (tableView == self.searchDisplayController.searchResultsTableView)
//crashing
// [self.FilterArray insertObject:dInner atIndex:count++];
else
[self.arForTable insertObject:dInner atIndex:count++];
[insertedIndexPath addObject:[NSIndexPath indexPathForRow:count inSection:0]];
}
Crash Log:-
-[__NSArrayI insertObject:atIndex:]: unrecognized selector sent to instance 0x9c754c0 2013-06-19 00:16:05.092 RA[2067:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI insertObject:atIndex:]: unrecognized selector sent to instance 0x9c754c0' * First throw call stack: (0x24a9012 0x198be7e 0x25344bd 0x2498bbc 0x249894e 0xeb4d 0x97f285 0x97f4ed 0x13895b3 0x2468376 0x2467e06 0x244fa82 0x244ef44 0x244ee1b 0x26e17e3 0x26e1668 0x8cfffc 0x2a4d 0x2975) libc++abi.dylib: terminate called throwing an exception
Filter Array is mutable array which have object from the search result.I am UISearchdisplaycontroller.