Trying to customize UITableViewCell with IB but having odd exception
Trying to customize UITableViewCell with IB but having odd exception
- Subject: Trying to customize UITableViewCell with IB but having odd exception
- From: James West <email@hidden>
- Date: Sat, 28 Jan 2012 00:55:54 -0600
In two classes, I've subclassed UITableViewCell in order to do some major customization. I'd like to use a Xib file to keep the amount of UI layout code to a minimum. I'm coming across an odd exception:
if (!cell) {
if (indexPath.row == 0) {
cell = [[[SearchCellTop alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
NSArray* objects = [[NSBundle mainBundle] loadNibNamed:@"SearchCellTop" owner:cell options:nil];
cell = (SearchCellTop*)[objects objectAtIndex:0];
}
else {
cell = [[[SearchCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
NSArray* objects = [[NSBundle mainBundle] loadNibNamed:@"SearchCell" owner:cell options:nil];
cell = (SearchCell*)[objects objectAtIndex:0];
}
}
This seems to work well for loading the Xibs. However as soon as I try doing something such as:
if (indexPath.row < [self tableView:tableView numberOfRowsInSection:indexPath.section])
((SearchCell*)cell).Product = [products objectAtIndex:indexPath.row];
I get -[UIAccessibiltyBundle setProduct:] unrecognized selector sent to instance
Everything indicates that 'cell' is of the correct type, however I'm still getting this error.
(SearchCellTop is a subclass of SearchCell)
--
James West
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden