0

ipadアプリを使用しているときに、一連のこの警告(Mar 18 11:18:06 kernel [0]:IOSurface警告:バッファー割り当てに失敗しました。980x606 fmt:42475241サイズ:2387968バイト)が50回以上発生しましたわずか20秒で、次のレポートでアプリがクラッシュしました。

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"];
        }
    }   
}

これがお役に立てば幸いです。

4

1 に答える 1

2

わかりました、ついに私は理由と解決策の両方を得ました。メモリの過剰使用により、OS はイメージをレンダリングするためのバッファを割り当てることができませんでした。この一連の警告を受け取った後、アプリがクラッシュしていました。メモリの使用量を減らし、目的を終えた直後にオブジェクトを解放したところ、この警告はまったくなくなりました。

于 2013-03-25T13:37:38.820 に答える