This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unsortedArray sortUsingComparator:^ NSComparisonResult(SearchResultItem *d1, SearchResultItem *d2) { | |
NSInteger doorID1 = d1.doorID; | |
NSInteger doorID2 = d2.doorID; | |
if (doorID1 > doorID2) | |
return NSOrderedAscending; | |
if (doorID1 < doorID2) | |
return NSOrderedDescending; | |
return [d1.handel localizedCompare: d2.handel]; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
[calendar setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; | |
NSDateComponents *dateComponents = [calendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:self]; | |
NSDate *midnightUTC = [calendar dateFromComponents:dateComponents]; |