问题描述:想计算某一段代码的执行时间,加了下面的代码:spa
NSDate *startTime; startTime = [NSDate date]; NSLog(@"Time: %f", -[startTime timeIntervalSinceNow]);
结果报错以下:code
[__NSCFString timeIntervalSinceNow]: unrecognized selector set to instanceclass
问题缘由很简单,由于startTime没有retain
date