开发者

app quits in iphone 4

开发者 https://www.devze.com 2023-02-24 07:38 出处:网络
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??/

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号