“IOSurface警告:缓冲区分配失败”导致应用程序崩溃

时间:2013-03-19 06:12:58

标签: ios objective-c ipad buffer

在使用我的ipad应用程序时,我得到了一系列此警告(3月18日11:18:06内核[0]:IOSurface警告:缓冲区分配失败.980 x 606 fmt:42475241大小:2387968字节)超过在20秒内完成了50次,应用程序因以下报告而崩溃:

Mar 18 11:18:35  ReportCrash[1428] <Notice>: Formulating crash report for process eDetail[1353]
Mar 18 11:18:35  ReportCrash[1428] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Mar 18 11:18:35  ReportCrash[1428] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/eDetail_2013-03-19-111833_iPad.plist using uid: 0  gid: 0, synthetic_euid: 501 egid: 0
Mar 18 11:18:35  com.apple.launchd[1] <Warning>: (UIKitApplication:com.****.profile***[0x1024]) Job appears to have crashed: Segmentation fault: 11
Mar 18 11:18:35  backboardd[26] <Warning>: Application 'UIKitApplication:com.****.profile***[0x1024]' exited abnormally with signal 11: Segmentation fault: 11

任何人都可以帮我找出这个问题的根本原因并解决它。

编辑:它也在代码的这一点上显示警告:

NSString *docsDir;
NSArray *dirPaths;

filemgr = [NSFileManager defaultManager];
// Get the documents directory


dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);    
docsDir = [dirPaths objectAtIndex:0];

// Build the path to the data file
dataFilePath = [[NSString alloc] initWithString: [docsDir stringByAppendingPathComponent: @"data.archive"]];

// Check if the file already exists
if ([filemgr fileExistsAtPath: dataFilePath]){

    NSMutableDictionary *dataDict = [NSKeyedUnarchiver unarchiveObjectWithFile: dataFilePath];
    if ([dataDict count] != 0) {
        m_cUserName.text = [dataDict objectForKey:@"UserName"];
        m_cPassword.text = @"";
        if([[dataDict objectForKey:@"AccountType"] isEqualToString:@"Specialty"]){
            m_cBgImage.image = [UIImage imageNamed:@"specialityloginbg.png"];
        }else {
            m_cBgImage.image = [UIImage imageNamed:@"infusionloginbg"];
        }
    }   
}

希望这可以提供帮助。

1 个答案:

答案 0 :(得分:2)

好的,最后我得到了理由和解决方案。由于内存过度使用,操作系统无法为渲染图像分配缓冲区。获得一系列此警告后,应用程序崩溃了。在完成目的后我立即减少了对内存和释放对象的使用,我完全摆脱了这个警告。