Handling out of memory errors in iPhone
- by hgpc
I would like to handle out of memory errors in iPhone to execute logic with lesser memory requirements in case I run of of memory. In particular, I would like to do something very similar to the followin pseudo-code:
UIImage* image;
try {
image = [UIImage imageNamed:@"high_quality_image.png"];
} catch (OutOfMemoryException e) {
image = [UIImage imageNamed:@"low_quality_image.jpg"];
}
First I attempt to load a high-quality image, and if I run out of memory while doing it, then I use a lower quality image.
Would this be possible?