i am using a custom uitablecellview like i used to do .But ,unfortunately ,this time an exception is thrown when a new cell appears.So,the same portion of code have worked perfectly many times before .The only difference is that the quality of images that i put into cells is very high.
Did you have ideas?or should i explain more?
Edit
some code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellView";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"SPViewControllCell" owner:self options:nil];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell=cellView;
self.cellView=nil;
}
UILabel *itemTitle=(UILabel*)[cell viewWithTag:1];
[itemTitle setFont:[UIFont fontWithName:@"Renaissance" size:24]];
itemTitle.text=[titles objectAtIndex:indexPath.row];
UIImageView *img=(UIImageView*)[cell viewWithTag:2];
img.image=[images objectAtIndex:indexPath.row];
return cell;
}
The exception :
“‘NSInvalidArgumentException’, reason: ‘-[UITableViewCell objectAtIndex:]: unrecognized selector sent to instance 0x5f36be0’
”
Thank you.
I’m guessing but is
titlesan array created with something like:Same goes for
images.What you have is the classic memory management issue where a reference you think points to say an
NSArraybut in fact that array is long gone and happenes to have be replaced my a some random other object.For completness: