Instruments - Leaks 用于分析 myApp。结果如下:
泄漏
# Address Category Event Type RefCt Timestamp Size Responsible Library Responsible Caller
0 0xe8b8120 Malloc 48 Bytes Malloc 1 00:30.130.300 48 myApp main
堆栈跟踪
0 libsystem_c.dylib 0x36fa9be3
1 libsystem_c.dylib 0x36fae57c
2 libnotify.dylib 0x364fe126
3 libnotify.dylib 0x364ff392
4 libnotify.dylib 0x364ff4fc
5 CoreFoundation 0x35276af4
6 CoreFoundation 0x35278066
7 UIKit 0x324448d4
8 UIKit 0x32426648
9 UIKit 0x324432d4
10 UIKit 0x324207ba
11 UIKit 0x323b0f0c
12 UIKit 0x325e1564
13 UIKit 0x3232d0fc
14 UIKit 0x3232bc4a
15 UIKit 0x32338990
16 UIKit 0x323387ce
17 UIKit 0x3233839c
18 UIKit 0x3231e83c
19 UIKit 0x3231e0e2
20 GraphicsServices 0x3655322a
21 CoreFoundation 0x352d4522
22 CoreFoundation 0x352d44c4
23 CoreFoundation 0x352d3312
24 CoreFoundation 0x352564a4
25 CoreFoundation 0x3525636c
26 GraphicsServices 0x36552438
27 UIKit 0x3234ce7c
28 myApp main /Developer/+Projects/myApp/myApp/main.m:16
29 myApp start
实际上我不知道如何修复 main.m 的泄漏。我该如何解决这个问题?提前致谢!
编辑 1
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
//line 16
}
}