This would not throw an exception if it was nil . You can still send the nil object if it normally replies to this message. In this case, you simply get 0. I think you are not allocating an array. Make sure you do this:
array = [[NSMutableArray alloc] init];
As a hint for debugging, if you are not sure about the state of the object and want to make sure that the object really exists and is ready to use, use assert(appdelegate.objects); If the array is zero, your code will stop executing on that line. If it does not stop at this line, you know that the object exists in memory.
Snowman
source share