这是标题:
@interface ForumBrowserAppDelegate : NSObject <UIApplicationDelegate> {
ForumSelection *forumSelection;
UIWindow *window;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet ForumSelection *forumSelection;
(我不确定 nonatomic 的作用,是否与使用多线程使其安全有关,我真的需要它吗?)
在主文件中:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubview:forumSelection.view]; //<<<< Instruments highlights this line
[forumSelection release];
[window makeKeyAndVisible];
}
最初我在标题或标题中没有属性,[forumSelection release];
所以我认为这可能是它泄漏的原因,但是 Instruments 仍然说这个泄漏,我不知道为什么?