I am writing an iPad application that has a label with a gradient image background. This has worked in 4.2 but it is working no longer. Every time I try to run I get a SIGABRT whether I am in 4.2 or 4.3. I will put the offending code below, I would appreciate any help. Thanks.
LabelSingAvg = [[UILabel alloc] initWithFrame:CGRectMake(70, -300, 200, 800)];
LabelSingAvg.text = @"99.8";
LabelSingAvg.font = [UIFont systemFon开发者_JAVA技巧tOfSize:90];
UIImage *myGradient = [UIImage imageNamed:@"textGradient.png"];
//Line that causes SIGABRT below:
LabelSingAvg.textColor = [UIColor colorWithPatternImage:myGradient];
LabelSingAvg.backgroundColor = [UIColor clearColor];
LabelSingAvg.textAlignment = UITextAlignmentCenter;
LabelSingAvg.adjustsFontSizeToFitWidth = YES;
LabelSingAvg.layer.shadowOpacity = .5;
LabelSingAvg.layer.shadowRadius = 4.0;
LabelSingAvg.layer.shadowColor = [UIColor blackColor].CGColor;
LabelSingAvg.layer.shadowOffset = CGSizeMake(1.0, 1.0);
//LabelSingAvg.alpha = 0.8;
[self.view addSubview:LabelSingAvg];
Nevermind, I got it. Thanks for your help. The image I was referencing got moved out of my resources folder.
精彩评论