dPompa Blog

Memory Warnings (aka: EXC_BAD_ACCESS)

As an iPhone developer you have to handle low memory situations gracefully and clear as much memory as you can. These can often lead to unexpected crashes if your memory management has a bug somewhere. If you wish to catch these easily then do the following:

  1. Go to your executable settings in Xcode and set the environment variable NSZombieEnabled to YES.

  2. Go to System Preferences > Keyboard > Keyboard Shortcuts and add a shortcut for the iPhone Simulator menu item called “Simulate Memory Warning”. I set mine to command+1.

    Simulate Memory Warning Shortcut

  3. Add a breakpoint (cmd + option + B in Xcode) at “objc_exception_throw”.

Now run your app in the simulator under the debugger, and trigger memory warnings while working your app. Trigger often, at the places your app probably won’t expect them. In fact, try triggering as much as you can.

The shortcut you defined allows you to send the warnings while the mouse operates the app. Since NSZombie throws an exception on each message it receives, you’ll break exactly where you need.

Have fun and good luck! :)

Photos!

Lately I’ve been introduced to the amazing world of photography. I was so amazed by this dazzling world that I decided to buy a new Nikon D90 and started a photography course. Expect more of these to come :)

What do you think?

Ease In?

So I’m looking for a good ease in timing function. Anyone know any?

Matalot featured in The Daily App Show

Matalot has been featured in The Daily App Show! If you’re looking for a video review or just feel like seeing your favorite ToDo manager in public, go check it out in full size!

Oh, and don’t forget to download it :)

A presentation at iDigital

About two weeks ago I got a call from Roey, asking if I’d like to give a presentation about iPhone development. Obviously I agreed immediately. I chose to talk about CoreLocation, MapKit and CoreAnimation. These are a few technologies which, in my opinion, Apple designed and built very well. They make the iPhone a very fun development environment, and allows everyone to produce stunning apps with very little effort.

For those of you who don’t know Roey, he’s one of the better guys at iDigital, Apple’s reseller at Israel. The presentation took place at their store at Dizengoff Center (Tel Aviv).

Pictures are available from Picasa, and a PDF of the presentation, together with the sample code used in it is available here.

I’d like to send a big thank you to the guys at Apple who wrote the replicator demo, and Joe Ricioppo for writing another awesome demo of CAReplicatorDemo.