Hi all..
Folowing is a custom View for SPLASH SCREEN what i created....
In my main Window i am loading this view for busy state..
But i am getting lmem-leak on the line
[window addSubView:splashScreenObject];
Instruments is not showing where in SplashScreen.m the leak is...
Kindly help me with where i went wrong in following code...
Folowing is a custom View for SPLASH SCREEN what i created....
In my main Window i am loading this view for busy state..
But i am getting lmem-leak on the line
[window addSubView:splashScreenObject];
Instruments is not showing where in SplashScreen.m the leak is...
Kindly help me with where i went wrong in following code...
Code:
//
#import "SplashScreen.h"
@implementation SplashScreen
-(id)initWithImageNamed:(NSString*)imageName backgroundColor:(UIColor*)bgColor
{
if(self = [super initWithFrame:[UIScreen mainScreen].applicationFrame])
{
self.backgroundColor = bgColor;
UIActivityIndicatorView *actView =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[actView startAnimating];
actView.center = CGPointMake(130.0,230.0);
[self addSubview:actView];
[actView release];
UIImage *splashImage = [UIImage imageNamed:imageName];
UIImageView *splashImageView = [[UIImageView alloc]initWithImage:splashImage];
CGPoint splashImageCenterPoint = CGPointMake([UIScreen mainScreen].applicationFrame.size.width/2.0,
[UIScreen mainScreen].applicationFrame.size.height - [splashImage size].height/2.0);
splashImageView.center = splashImageCenterPoint;
[self addSubview:splashImageView];
[splashImageView release];
UILabel *loadingLabel = [[UILabel alloc]initWithFrame:CGRectMake(125.0,220.0,80.0,30.0)];
loadingLabel.text = @"Loading...";
loadingLabel.textColor = [UIColor grayColor];
loadingLabel.backgroundColor= [bgColor colorWithAlphaComponent:0.0];
//loadingLabel.shadowOffset = CGSizeMake(1.0,1.0);
//loadingLabel.shadowColor = [UIColor blackColor];
[self addSubview:loadingLabel];
[loadingLabel release];
return self;
}
return nil;
}
-(void)dealloc
{
[super dealloc];
}
@end