Friday, February 20th, 2009 Share on Twitter
In my current project, I needed to know if a given NSDate was today, yesterday or earlier. Simple task, I thought. Until I looked at the documentation for NSCalendar, NSDateComponents and NSDate. While these are extremely powerful, I am not proud of the code I've written. It should be easier.
Anyway, ...
Posted in cocoa, iPhone | 8 Comments »
Saturday, February 14th, 2009 Share on Twitter
A beta-tester was complaining the application was draining its battery. To check if this was really the case, I needed to get the battery level with a better accuracy than just looking at the battery icon. So I used this little routine to check.
This routine is adapted from a post ...
Posted in cocoa, iPhone | 17 Comments »