我正在創建一個應用程序,需要找出當前日期是否處於多個日期範圍之一中,並且取決於它所在的位置,它需要將枚舉設置爲一個值。我有以下代碼,但我不知道如何用多個參數調用該函數。另外,啓動一個函數與+或 - 符號有什麼區別?調用具有多個參數的方法
+ (BOOL)rangeFinder:(NSDate*)date isBetweenDate:(NSDate*)beginDate andDate: (NSDate*)endDate
{
if ([date compare:beginDate] == NSOrderedAscending)
return NO;
if ([date compare:endDate] == NSOrderedDescending)
return NO;
return YES;
}
感謝,
赫什
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocObjectsClasses.html#//apple_ref/doc/uid/TP30001163-CH11-SW1 – Vin