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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -