尝试在iOS 7上的集合视图中加载图像时出现内存警告

Abd*_*ski 1 memory-leaks objective-c uiimage uicollectionview ios7

在iOS7上的Collection View中加载图像时,我收到此警告

警告: failed to set breakpoint site at 0x11428984c for breakpoint 1.1: Unable to read memory at breakpoint address.

这就是我加载图像的方式

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView1
              cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
cellDesign* newCell = [collectionView1 dequeueReusableCellWithReuseIdentifier:@"myCell" forIndexPath:indexPath];
NSString *str = [combinedArrays[indexPath.section] objectAtIndex:indexPath.row];
newCell.templateName.text = str
newCell.displayTemplate.image = [UIImage imageNamed:str];
return newCell;
}
Run Code Online (Sandbox Code Playgroud)

Eug*_*ene 6

这不是内存警告,您的代码工作正常,不会因内存不足而崩溃.此警告很可能是由某些内部Xcode IDE代码引起的,该代码尝试在内存地址"0x11428984c"中的某个位置使用LLDB设置动态断点,但由于无法读取它而失败.

  • 看看Breakpoints导航器......并删除不需要的断点,它适用于我. (2认同)