Should I always check if [[NSArray alloc] init…] (or with any other collection class) returns nil? The Apple docs say that objects may return nil if allocation or initialisation fails. I don't know when initialising may fail with NSArray, but I guess that allocation may fail with insufficient memory. And because I'm developing for iOS, that may become a regular problem. Do I have to about that and check every time I want to create a new array, or will my app fail because of memory constraints (assuming worst-case situation, of course) and checking for nil is just a waste of cycles?
Currently, I'm only checking when I allocate a mutable collection with a large predetermined capacity (e.g. [NSMutableArray arrayWithCapacity: 1000]) or an immutable collection with lots of objects (over a thousand).
Thank you.