Я создал настройку UIView с помощью следующего кода ..... он работает без проблем .... но когда я проверяю утечки памяти ... он показывает утечки в точке, где я сделал комментарий ... это подкласс Uiview.
Пожалуйста, помогите мне ...
-(id) initWithLabel:(NSString*)labelName{
self = [super init];
if (self) {
self.layer.cornerRadius=8.0f;
self.layer.borderColor=[UIColor whiteColor].CGColor;
self.layer.borderWidth=2.0f;
/*memory leaks 28.6% */ [self setBackgroundColor:[UIColor colorWithRed:51.0/255 green:51.0/255 blue:51.0/255 alpha:1]];
[self setFrame:CGRectMake(86, 168, 160, 77)];
[self setAlpha:1];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 28, 75, 21)];
[label setBackgroundColor:[UIColor clearColor]];
[label setTextAlignment:UITextAlignmentLeft];
[label setTextColor:[UIColor whiteColor]];
[label setFont:[UIFont fontWithName:@"Helvetica" size:17]];//memory leak 57%
[label setText:labelName];
[label setOpaque:NO];//memory leak
[self addSubview:label];
[label release];
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(108, 22, 37, 37)];
[activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge];
[activityIndicator setBackgroundColor:[UIColor clearColor]];
[activityIndicator setHidesWhenStopped:YES];
[self addSubview:activityIndicator];
[activityIndicator release];
}
return self;
}