Let's say you want to write a method that looks something like this: - (NSNumber *)nextReminderId { NSNumber *currentReminderId = [[NSUserDefaults standardUserDefaults] objectForKey:@"currentReminderId"]; if (currentReminderId) { // Increment the last reminderId currentReminderId = @([currentReminderId intValue] + 1); } else { // Set to 0 if it doesn't already exist currentReminderId = @0; } // Up