Blog

An important lesson about NSCalendarComponents

I recently stumbled across some code that was so bad I had to comment on it.
//returns a Hebrew date from a Gregorian date
- (NSDate*)convertHebrewDateWithDate:(NSDate*)date {

When I saw this I was shocked! As you may already know an NSDate does not have any calendar information attached to it. It is a point in time. Internally it is a…

Read More

Countdown to a point in time using NSDate and NSDateFormatter

Last year we wrote an app for a summer camp – Camp Morasha – for the iPad, iPhone and iPod touch. Part of the app had a large countdown to when camp started. Programming a countdown in iOS is not particularly difficult but it does have a few challenges.
In the UIViewController that contains the countdown…

Read More

Display UIAlertView when a new version of your app is available

On the iPhone and iPad updates are managed by the App Store app which will get a badge (a red circle with a number in it) when any app has an update available. Some users update all the app and never let the number…

Read More

Finding Jewish Holidays with NSDate and NSCalendar

Finding the NSDate of a the next Jewish holidays is pretty easy with NSDate and NSCalendar. First figure out what point in time the holiday fall on, then convert that point in time to something useable.
If you know what Jewish calendar date you are looking for it is pretty easy, for example Passover is the 15th of Nisan,…

Read More

Protesting SOPA

Yesterday, January 18, Appstudio blacked out its website to protest SOPA legislation being debated in the US congress. This blackout was part of an Internet wide campaign to raise awareness of the damage this bill will do to the Internet. Under the proposed bill copyright holders will have the power to shut down any website and put…

Read More

NSDate and its friends

NSDate and its friends

Dates and time in iOS can be very confusing. There are many classes that interact in different ways whereas many other languages have a single date class. These interactions are not immediately obvious and iOS documentation rarely presents overviews and instead just jumps into the minutiae. Lets start by summarizing the basic date and time classes NSDate,…

Read More