@interface ViewController (){
UITextField txtPhoneNo;
UITableView *tvCompanyCode;
}
@end
原来的一些控件在ViewController ()里面声明,执行到
[tvCompanyCode setDelegate:self];
[tvCompanyCode setDataSource:self];
[self.view addSubview:tvCompanyCode];这一句之后就报错,并且前两句有警告,警告内容如下:
Sending 'ViewController *const __strong' to parameter of incompatible type 'id _Nullable'
报错内容:
2017-10-11 16:22:25.714075+0800 Demo[1539:681757] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-10-11 16:22:25.717037+0800 Demo[1539:681757] [MC] Reading from public effective user settings.
2017-10-11 16:23:08.599117+0800 Demo[1539:681757] -[ViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x109e0b7b0
2017-10-11 16:23:08.600113+0800 Demo[1539:681757] ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x109e0b7b0'
*** First throw call stack:
(0x18a292fd8 0x188cf4538 0x18a299ef4 0x18a296f4c 0x18a192d2c 0x19070c414 0x19049ed74 0x19049e544 0x19049e2cc 0x19049e100 0x190700480 0x1904a39bc 0x1903be750 0x1903e2104 0x1903bd9d0 0x18accca6c 0x1903bd848 0x1903c9744 0x1903c9060 0x1000a4cc8 0x1903f70ec 0x1903f706c 0x1903e15e0 0x1903f6950 0x1903f646c 0x1903f1804 0x1903c2418 0x190bbbf64 0x190bb66c0 0x190bb6aec 0x18a241424 0x18a240d94 0x18a23e9a0 0x18a16ed94 0x18bbd8074 0x190427130 0x1000a555c 0x18917d59c)
libc++abi.dylib: terminating with uncaught exception of type NSException
看网上一些tableview控件声明的地方是@interface ViewController :UIViewController
我把上面的改成这个之后其他的控件又都不能用了,请问这个应该怎么去改,刚开始学iOS开发,请大神指教,谢谢。