Tools: memory leak when creating UIButton

I am trying to find out why, when creating a UIButton in the interface builder, a memory leak occurs when starting the tool application using xcode.

This is how I created a memory leak.

I opened a new application, opened the file myAppViewController.xib in the interface builder. I changed the background to black. Added UIButton, renamed to "foo" header. saved and then quit.

In the file myAppViewController.h I have

#import <UIKit/UIKit.h>

@interface miPlanNewViewController : UIViewController { 
    IBOutlet UIButton *tasksProjects; 
}
@property(nonatomic, retain) IBOutlet UIButton *tasksProjects;
@end

in myAppViewController.m file I have the following:

#import "miPlanNewViewController.h"

@implementation miPlanNewViewController
@synthesize tasksProjects;

...
//the normal methods you get
...
- (void)dealloc {
    [super dealloc];
}
@end

Here is a screenshot of what I am currently getting in the tools.

alt textalt text

One thing I notice, however ....

uibutton , UIButton , , .

- , . .

+3
1
  • -, . dealloc [tasksProjects release]; viewDidUnload self.taskProjects = nil;
  • -, lxt metioned, .
  • -, , , .
+2

Source: https://habr.com/ru/post/1784381/


All Articles