出错提示:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MasterViewController setRefreshControl:]: unrecognized selector sent to instance 0x2681e0'
同样的代码在模拟器上运行,在设备上就不运行。不知道为什么?
出错提示:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MasterViewController setRefreshControl:]: unrecognized selector sent to instance 0x2681e0'
同样的代码在模拟器上运行,在设备上就不运行。不知道为什么?
错误的异常提示MasterViewcontroller中没有可识别的方法setRefreshControl
有一种可能是你所使用的编译器的SDK版本高(ios5.0以上)
我们知道,在ios5.0 以后定义属性后可以不需要再@synthesize 来告知编译器生成getter,setter方法,如果你是在高版本的环境中运行,是没有问题,如你说的你在模拟器中运行正常,但在真机设备上来运行时就出错。那么很有可能就是你的真机的ios版本低,在运行这个app时由于没有使用@synthesize来告知编译器生成getter,setter,所以当我们在使用到setRefreshControl这个方法时,就报出了没有找到该方法的异常。
这是我的猜测,你可以参考一下。