views:

148

answers:

1

If an iOS device cannot successfully [NSObject alloc] (because it is out of memory), will it return nil, throw an exception, or will the OS terminate the app?

A: 

There are stages. You will receive memory warnings when the device is running low on memory. You see these in template classes as -(void)didReceiveMemoryWarning methods. This is the place where you release anything you don't need, and it's also where the OS starts unloading objects.

The second stage is that your application is terminated.

Kalle