Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'

I am working with UITableview i am displaying image, title,date and location name on tableview cell.When i click on tableview cell it will navigate to details view.in continuous process tableview to detail view and vice versa.After some navigations my application getting crash when i click on my UITableview cell.

like image 518
khaleel Avatar asked Nov 10 '12 06:11

khaleel


1 Answers

NSArray is designed to hold objects for every element -- nil is never a valid value at any NSArray index.

The error suggests your program is creating an array with a non-zero length, and that the first element is nil.


Hunch: You have declared a literal, something equivalent to:

NSNumber * n = nil;
NSArray * a = @[n]; // << runtime error creating this array

Of course, your program could instead be calling -[NSArray initWithObjects:count:] directly.

like image 114
justin Avatar answered Oct 17 '22 06:10

justin