I am new at objective c,
I am taking two dates and getting the number of days in between:
NSString *start = @"2010-12-01";
NSString *end = @"2010-12-02";
NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd"];
NSDate *startDate = [f dateFromString:start];
NSDate *endDate = [f dateFromString:end];
NSDateComponents *components;
NSInteger days;
components = [[NSCalendar currentCalendar] components: NSDayCalendarUnit
fromDate: startDate toDate: endDate options: 0];
days = [components day];
When I try to assign days to cell.textLable.text = days
, but I get this error message:
Thread 1: EXC_BAD_ACCESS(code=1, address=0x1)
cell is this SGridAutoMultiLineCell *cell;
what does error mean and how do I fix it. the number that is being returned is 1.