In my cocoa application, i am uploading files to my server. And i have status bar to display the current status of file uploads. When i click on the status bar, it will show the status of current uploading file. For displaying the current status, i am adding retrieved value as objects to array. Here i given the code for adding objects to array.
if(temp1 != Nil)
{
[printComplete addObject:temp1];
}
Same type of code has been used in my code at multiple points. But sometime i am getting the below error even after checking the nil:
-[__NSArrayM insertObject:atIndex:]: object cannot be nil
I can't get this error when i run this code from Xcode / at debugging stage. It occurs rarely when i run this as app. Can anyone provide the solution to resolve this issue.