ios - Detect If between time periods -
I'm having trouble with the code given below. What's the problem with it? I have tried to define the . > Anything that is In addition, NSUInteger as
int , but it still does not work.
NSCalendar * cal = [NSCalendar currentCalendar]; NSDateComponents * Component = [KAL component: NSHourCalendarUnitDate: now longer]; NSLog (@ "% LD", [hours of components]); NSUInteger * timeHour = [component hours]; If it is between 5 and 9 in the morning for the code, then it can be ascertained that
timeHour & lt; 5 Automatically
timeHour> 9 . You are desirous of these two situations, which can never be true at the same time, so you will always make a wrong return.
if is nothing in the block
if (timeout => 5 & amp; amp; Time holes & lt; = 9) {// stuff}
timeHour> = 5 gives the right for anything where
is greater than
Comments
Post a Comment