【发布时间】:2010-04-22 03:14:19
【问题描述】:
我尝试设置 tableView 背景图像有几个小时。 我的控制器是 UITableViewController 的子类,我简单地写了这行 ViewDidLoad 方法中的代码。
UIImage *image = [UIImage imageNamed:@"home-portrait-iphone.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
self.tableView.backgroundView = imageView;
模拟器上的一切看起来都很棒,我的意思是,我看到了我的表格,作为背景视图,你可以看到图像。但是当应用程序在设备上运行时(ipod touch),我得到了这个错误:
节目接收信号:“SIGABRT”。
堆栈说:
* -[UITableView setBackgroundView:]:无法识别的选择器发送到实例 0x812e00 * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“*** -[UITableView setBackgroundView:]: unrecognized selector sent to instance 0x812e00”
并且在赋值中抛出异常,意思是这一行:
self.tableView.backgroundView = imageView;
有什么想法吗?
提前谢谢你。
【问题讨论】:
标签: iphone uitableview