gpt4 book ai didi

ios - "IOSurface warning: buffer allocation failed"导致应用崩溃

转载 作者:行者123 更新时间:2023-11-28 22:37:36 26 4
gpt4 key购买 nike

在使用我的 ipad 应用程序时,我收到了一系列警告(Mar 18 11:18:06 kernel[0] : IOSurface warning: buffer allocation failed. 980 x 606 fmt: 42475241 size: 2387968 bytes)超过仅 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"];
}
}
}

希望对您有所帮助。

最佳答案

好的,终于找到原因和解决办法了。由于过度使用内存,操作系统无法为渲染图像分配缓冲区。在收到一系列此警告后,App 崩溃了。我减少了内存的使用,并在完成目标后立即释放了对象,我完全摆脱了这个警告。

关于ios - "IOSurface warning: buffer allocation failed"导致应用崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15492635/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com