Possible Duplicate:
How to write a method/message with multiple parameters?
I am really confused here... I have looked at SO and Google where I found an example of calling a method with two parameters. So I modified it for my use, and unfortunately I can't get it to work. Here is my updated code:
- definition of method
- (NSArray *) fetchEventsBetweenDates: (NSDate *) sDate: andDate: (NSDate *) eDate;
- definitions and creation of sD and eD
// convert start dates to NSDate
NSDateFormatter* df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"MM/dd/yyyy"];
NSDate* sD = [df dateFromString:@"10/03/2012"];
NSLog(@"startDate: %@", sD);
// convert end dates to NSDate
NSDate* eD = [df dateFromString:@"10/05/2012"];
NSLog(@"endDate: %@", eD);
- call to method
[self.eventsList addObjectsFromArray:[self fetchEventsBetweenDates: sD andDate: eD]];
- method
- (NSArray *) fetchEventsBetweenDates: (NSDate *) sDate: andDate: (NSDate *) eDate {
I have tried every permutation I think was reasonable, and it still will not build. I am getting a "expected ':' on the call to the method.
What am I doing wrong?