i trying set email picker have subject of message "tonight", "tomorrow","today", or defaults "later"
have far. how can tonight , today show?
code:
int timezonedifference; nsdate *tomorrowsdate = [nsdate datetomorrow]; nstimezone* timezone = [nstimezone systemtimezone]; timezonedifference = [timezone secondsfromgmt]; nsdate *startdate = [ _event.startdate datebyaddingtimeinterval:timezonedifference]; if ([startdate isequaltodateignoringtime:tomorrowsdate]) { nslog(@"title tomorrow"); [controller setsubject:[nsstring stringwithformat:@"tomorrow - %@", _event.name]]; } else if (startdate.hour > timezonedifference) { nslog(@"title today"); [controller setsubject:[nsstring stringwithformat:@"today - %@", _event.name]]; } else if (startdate.hour <= timezonedifference) { nslog(@"title tonight"); [controller setsubject:[nsstring stringwithformat:@"tonight - %@", _event.name]]; } else { nslog(@"title later"); [controller setsubject:[nsstring stringwithformat:@" - %@", _event.name]]; }
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
Comments
Post a Comment