这段代码有什么问题?
NSDate *matchDateCD = [[object valueForKey:@"matchDate"] description]; // from coredata NSDate
NSDate *add90Min = [matchDateCD dateByAddingTimeInterval:5400];
if ( matchDateCD >=[NSDate date] || add90Min <= matchDateCD )
{
cell.imageView.image = [UIImage imageNamed: @"r.gif"];//Show image in the table
}
Run Code Online (Sandbox Code Playgroud)
如果比赛正在进行或90分钟,我需要在表格中显示此图像
我对这个很困惑.
我想抓住当前时间,而不是根据条件,我想将所需时间添加到当前时间.例如.
current time = 06:47:10
//or should i hv to change this format to "2011-03-26 06:47:10 GMT"
if(a= 1 and b= min )
{ //add 1 min to
current time
}
else if(a= 1 and b= hour)
{ //add 1
hour to current time
}
else if(a= 1 and b=week )
{ //add 1
week to current time
}
Run Code Online (Sandbox Code Playgroud)
只需要将上述条件的输出添加到当前时间.
请指导我这个.
问候