I am creating an application that needs to find out if the current date is in one of several date ranges, and depending on which one it is in, it needs to set an enum to a value. I have the following code, but I don’t know how to call the function with multiple arguments. Also, what is the difference between starting a function with a + or – sign?
+ (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;
}
Thanks,
Hersh
A method starting with ‘+’ denotes the method is a class method so you don’t need an instance to call it… i.e.
As opposed to method starting with ‘-‘ which denotes an instance method ….
As for calling methods with multiple params….