In C, you can check if the system has enough free memory by checking the return value of a call to malloc(). How do you check if the system has enough free memory in Objective-C? Does alloc throw an exception if there is not enough memory?
I have created a class that derives from NSObject for an in-memory photo cache. I need to check before saving something into the cache if there is enough memory, and can't quite figure out the proper way to do so.
Thanks