Memory leak using datePicker.datePickerMode

I am creating a custom view that includes a date picker. My application is running slowly and the tools show that I have a memory leak. Leaking line:

datePicker.datePickerMode = UIDatePickerModeDate;

      

Any help would be greatly appreciated, I don't know why this is causing the leak. The complete method is below.

- (UIView *)createDemoView
{
    UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 260)];
    CGRect rect = CGRectMake(0, 0, 280, 60);
    UITextView *textView = [[UITextView alloc] initWithFrame:rect];
    textView.backgroundColor=[UIColor clearColor];
    textView.font = [UIFont fontWithName:@"Cochin" size:13];
    textView.text = @"Please Enter Your Birthday";
    textView.textAlignment = NSTextAlignmentLeft;
    UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(-18,50,162,162)]; //-10.0f, 40.0f, 130.0f, 200.0f)];
    datePicker.datePickerMode = UIDatePickerModeDate;
    [datePicker addTarget:self action:@selector(dateChanged:) forControlEvents:UIControlEventValueChanged];
    [demoView addSubview:textView];
    [demoView addSubview:datePicker];
    return demoView;
}

      

+3
ios memory-leaks objective-c datepicker


source to share


No one has answered this question yet

Check out similar questions:

3044
Making a memory leak with Java
1146
performSelector may leak because its selector is unknown
1042
The result was a leak of the window that was originally added
229
What leaks does automatic reference counting in Objective-C do not prevent or minimize?
204
Are memory leaks ever?
164
memory leak detected EventEmitter
156
How to find memory leaks in C ++ code / project?
155
Anatomy of a "memory leak"
136
Finding memory leaks in JavaScript with Chrome
106
Python memory leak



All Articles
Loading...
X
Show
Funny
Dev
Pics