【发布时间】:2012-03-22 06:41:57
【问题描述】:
大家好,我想在 tableview 中显示更多 120 images,它在模拟器中运行良好,但在设备 (ipad) 中崩溃。
日志显示内存警告,但我正在完美释放我不知道为什么我收到此消息并崩溃。图片来自我正在使用以下代码的服务器。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
FullTableViewCell *cell = (FullTableViewCell *)
[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"FullTableViewCell" owner:nil options:nil];
for (id currentObject in topLevelObjects) {
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (FullTableViewCell *)currentObject;
break;
}
}
}
NSDictionary *dic = [socketConnection().imageInfoArray objectAtIndex:indexPath.row];
int imageId = [[dic objectForKey:@"id"] intValue];
UIImage *image = [socketConnection().serverImageArray objectAtIndex:indexPath.row];
UIImage *IMMage = [self scaleImage:image toResolution:740];
cell.cellIMage.image = IMMage;
cell.addButton.tag = imageId;
cell.zoomOutButton.tag = imageId;
[cell.zoomOutButton addTarget:self action:@selector(_ZoomOut:) forControlEvents:UIControlEventTouchUpInside];
[cell.addButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
cell.transform = CGAffineTransformMakeRotation(3.14159265+(3.14159265/2));
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
请任何人帮助我哪里我错了..
【问题讨论】:
-
你能运行仪器,看看其中哪一个泄漏了吗?
-
scaleImage会不会有问题? -
我用仪器没问题...