how to declare NSOrderedDecending
static NSInteger shakeCount=0;
static NSDate *shakeStart;
static NSOrderedDecending;
NSDate *now=[[NSDate开发者_StackOverflow中文版 alloc]init];
NSDate *checkDate=[[NSDate alloc] initWithTimeInterval:1.5f sinceDate:shakeStart];
if([now compare:checkDate]==NSOrderedDecending || shakeStart ==nil)
{
shakeCount=0;
[shakeStart release];
shakeStart=[[NSDate alloc]init];
}
[now release];
[checkDate release];
if(fabsf(acceleration.x) > 2.0
|| fabsf(acceleration.y) > 2.0
|| fabsf(acceleration.z) > 2.0)
{
shakeCount++;
if(shakeCount>4)
{
shakeCount=0;
[shakeStart release];
shakeStart =[[NSDate alloc]init];
}
}
}
But getting error as "NSOrderedDecending not declare".
It's NSOrderedDescending
, not NSOrderedDecending
. Note deSCend vs. deCend
精彩评论