【原】push过快的错误 (Pushing the same view controller instance more than once is not supported)

今天在点击按钮push viewController 时,控制台报错:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported

网上查了以下原因, 是说过快点击可能会产生多次push的情况,在MVC里是不支持这种事件的,所以,保险起见,在可能出现这种情况的push事件里,加以判断即可。

if(![self.navigationController.topViewController isKindOfClass:[currentCLASS class]]) {

参考:http://*.com/questions/7083124/pushing-the-same-view-controller-instance-more-than-once-is-not-supported-exce
上一篇:Elasticsearch 通关教程(六): 自动发现机制 - Zen Discoveryedit


下一篇:坑:jmeter代理服务器录制脚本出现target controller is configured to "use recording Controller" but no such controller exists...