UITableView background customization strange behavior

Posted by Omer on Stack Overflow See other posts from Stack Overflow or by Omer
Published on 2010-04-21T16:43:37Z Indexed on 2010/04/21 17:13 UTC
Read the original article Hit count: 589

Filed under:
|

Hi, There is a couple of hours that I'm trying to set a tableView background image. My controller is a subclass of UITableViewController, and I simply wrote this lines of code in ViewDidLoad method.

UIImage *image = [UIImage imageNamed:@"home-portrait-iphone.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
self.tableView.backgroundView = imageView;

Everything looks great on the simulator, I mean, I see my table and as background view, y can see the image. But when the app is running on the device (ipod touch), I get this error:

Program received signal: “SIGABRT”.

and the stack says:

* -[UITableView setBackgroundView:]: unrecognized selector sent to instance 0x812e00 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[UITableView setBackgroundView:]: unrecognized selector sent to instance 0x812e00'

and the exception is thrown in the assignment, a mean this line:

self.tableView.backgroundView = imageView;

any ideas?

Thank you in advance.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview