我正在忙着制作一个从.plist加载大量名称的应用程序。我已经进行了设置,以使.plist加载到UiTableView中。现在的问题是,每当尝试打开带有名称表的菜单时,都会收到错误代码。
这是错误消息:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc748e37ea0'
这是我的viewController.m
#import "ViewController.h"
#import "Stuff.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
Stuff *s = [[Stuff alloc] init];
[s getStuff];
self.items = [[NSMutableArray alloc] initWithArray:s.stuff];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ …
Run Code Online (Sandbox Code Playgroud)