Если Вы - пользователь свободного выпуска Visual Studio Express, правильный ключ находится в
HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
{отмечают VCExpress вместо VisualStudio), но это работает!:)
Я рекомендую использовать объект NSDate
для хранения времени закрытия магазина вместо использования вашего собственного целочисленного формата. Очень жаль, что NSDate
представляет и дату, и время.
В любом случае вы можете проверить NSDateComponents
. У вас может быть такой метод утилит:
int minutesSinceMidnight:(NSDate *)date
{
NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
unsigned unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit;
NSDateComponents *components = [gregorian components:unitFlags fromDate:date];
return 60 * [components hour] + [components minute];
}
If you have another NSDate
which is set to midnight, then you can use the timeIntervalSinceDate
method of the NSDate object to get an NSTimeInterval
back with the difference between the two. Alternatively, if you're always wanting to compare midnight with the current time, you could call the timeIntervalSinceNow
method on the midnight NSDate and you'd get an NSTimeInterval
back (albeit negative) with the difference between midnight and the current time.
NSTimeInterval
is defined as a double
by the standard which holds a number of seconds (and any fractional seconds).