ios - getting "exc_bad_access code=2" -
hi, developing iphone application , using nscalendar class,have taken currentmonth of nsdate type. getting "exc_bad_access code=2" error.
i have used following code:
nscalendar *gregorian = [[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar]; nsdatecomponents *offsetcomponents = [gregorian components:(nsyearcalendarunit | nsmonthcalendarunit | nsdaycalendarunit)fromdate:[nsdate date]]; currentmonth = [gregorian datebyaddingcomponents:offsetcomponents todate:currentmonth options:0]; so can me solve problem.
Comments
Post a Comment