Update

Hi:

At first I would like to thank you. Your code has been very useful to me.

I did a few changes (little details) in order to use it in iOS 5 and 6, so I send this pull request. I hope you find it helpful.

Regards.