我有一些非常奇怪的事情发生。我的应用程序,一个非常简单的应用程序,它捆绑了200mb视频作为教程,当应用程序第一次打开时,它将一张照片(4mb)保存到Documents目录。它还可以节省很多NSUserDefult(20或更多),但所有这些都是字符串和数字。起初我的应用程序的文档和数据是0gb,但是在使用1小时后它甚至达到17gb,直到它填满了内存。 你们有谁知道为什么?
编辑:
我经常保存这样的文件:
NSString *filename2 = [NSString stringWithFormat:@"%@%@newFile.json", destDir, NavBar.topItem.title];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *ReloadPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@newFile.json", NavBar.topItem.title]];
[self.restClient loadFile:filename2 intoPath:ReloadPath];
并像这样写下来......
[jsonData writeToFile: uploadPath atomically: YES];
我也使用NSTemporary目录,我的分发堆栈,垃圾收集和malloc堆栈都已打开。