static NSInteger shakeCount=0;
static NSDate *shakeStart;
static NSOrderedDecending;
NSDate *now=[[NSDate 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];
}
}
}
但是错误是“NSOrderedDecending not declare”。
答案 0 :(得分:2)
它是NSOrderedDescending
,而不是NSOrderedDecending
。注意de SC 结束与de C 结束