¡@

Home 

2014/10/15 ¤U¤È 10:05:48

iphone Programming Glossary: currentday

How To Populate UIPicker with Current Day of week + Date,

http://stackoverflow.com/questions/4611431/how-to-populate-uipicker-with-current-day-of-week-date

now we have all the days and date so lets format them so they look good for int i 0 i daysForPicker count i NSString currentDay NSString stringWithFormat @ @ daysForPicker objectAtIndex i we have date now look at 2nd to last digit and check if it is.. objectAtIndex i we have date now look at 2nd to last digit and check if it is a zero if so remove it. NSUInteger count currentDay length 1 NSRange r NSMakeRange count 1 NSString lastChar currentDay substringWithRange r if lastChar isEqual @ 0 TRUE replace.. if it is a zero if so remove it. NSUInteger count currentDay length 1 NSRange r NSMakeRange count 1 NSString lastChar currentDay substringWithRange r if lastChar isEqual @ 0 TRUE replace it with nothing else not a zero at the end so we are good to..