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?
If an iOS device cannot successfully [NSObject alloc] (because it is out of memory),
Share
There are stages. You will receive memory warnings when the device is running low on memory. You see these in template classes as
-(void)didReceiveMemoryWarningmethods. 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.