Adding Badge Count to the Application Icon | iOS Programmer Guide

Since iOS4 the UIApplication class has a property called applicationIconBadgeNumber. You can assign any integer greater than or equal to 1 to the property, applicationIconBadgeNumber.

Below example code snippet shows how to set the number on the application badge:

[UIApplication sharedApplication].applicationIconBadgeNumber = 23;