app quits in iphone 4
i am using this , but if i start my app again on iphone 4 then it quits , problem is it dont know indexpath开发者_JS百科.row , now how to solve this isuee??/
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
int j=indexPath.row;
if(j==0)
{
UIImage *bgImage = [UIImage imageNamed:@"logo_jurong.png"];
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:bgImage];
[bgImageView setFrame:CGRectMake(7, 13, 30, 30)];
//Finally give this imageView to the cell
[cell.contentView addSubview:bgImageView];
[bgImage release];
}
}
Instead of [bgImage release];
write [bgImageView release];
You shouldn't be releasing bgImage. It is already autoreleased.
精彩评论