How do I get current year as string in Obj-C ?
Also how do I compare the same using another year value ?
Is it advisable to do a string comparision OR dirctly ye
you can get by following code in objective c
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]]; int year = [components year]; NSString *strFromyear = [NSString stringWithFormat:@"%d",year];