Posterous theme by Cory Watilo

Simulating iOS memory warnings

Hi, here's some code i threw together for simulating memory warnings in your app, so you can be sure you're handling them well.

It only affects the simulator, so in production you'll be just the same. This uses method swizzling to extend your view controllers, so that every time a viewWillAppear is called, it simulates a memory warning. And you don't need to change your view controllers' base class or anything, so this file is easy to drop in (and out of) a pre-existing project for the duration of your memory usage/leak testing.

Many thanks to cocoawithlove and idevrecipes for most of the below code, I just combined it all to work together so you don't need to change your view controllers at all. Simply create a 'MemoryWarnings.m' file in your project and paste the below code in it:

Random Chef

Random Chef is an iPhone app that helps with the inevitable question, as you prepare the weekly shopping list:

"What do we want to have for dinner this week?"

Go to Random Chef in the App store

Now, with Random Chef, you can tap the Random button and it automatically chooses a weeks worth of recipes for you, from your personal recipe book, and creates a shopping list for all their ingredients.

Random Chef comes with 14 of my favourite recipes, however it (unlike many recipe apps) encourages you to enter your own recipes and their ingredients.

A combined shopping list is created, which you can use to tick off the items as you purchase them, or if they're already in your cupboard.

It also has a very neat recipe view screen, where you can view the ingredients and instructions as you cook your meals

(download)

I really hope you enjoy this app, it's been a pleasure to bring it to you.

For any support questions, feel free to leave a comment below.

Chris

Attributions / Credits

App icon by Laura design
Icons from Alex Shutin/The Working Group
Textures from Dazzle Textures
Toolbar icons from app-bits