Blog

An important lesson about NSCalendarComponents

Posted on Feb 21, 2012

I recently stubbled 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

Posted on Feb 9, 2012

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

Posted on Feb 2, 2012

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

Posted on Jan 23, 2012

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

NSDate and its friends

Posted on Dec 26, 2011

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

CAEmitterLayer – adding fire to your UIViews

Posted on Dec 5, 2011 | 2 comments

CAEmitterLayer – adding fire to your UIViews

In IOS 5 a cool feature that was adding was the CAEmitterLayer class. It allows you to make a latter “emit” objects. You can control the rate, direction, color, opacity, rotation, shape and behavior of these objects to make some very nice effects such as fire, smoke, and water.
Ray Wenderlich has a great turtorial for how to…

Read More