_OBJC_CLASS_S_CAGradientLayer Objc-class-ref in 错误查找

 

 

如下代码中注释掉的部分均会引起此错误。

 

    if (shouldUseShadows) {

        UIView *upperShadow = [[UIViewalloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.bounds.size.width, self.bounds.size.height*1/3)];

        [v setBackgroundColor:[UIColor greenColor]];

//        CAGradientLayer *gradient = [CAGradientLayer layer];

//        gradient.frame = upperShadow.bounds;

//        gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor clearColor] CGColor], nil];

//        [upperShadow.layer insertSublayer:gradient atIndex:0];

//        [upperShadow setUserInteractionEnabled:NO];

        

        [self addSubview:upperShadow];

        

        UIView *lowerShadow = [[UIViewalloc] initWithFrame:CGRectMake(0.0f, self.bounds.size.height-self.bounds.size.height*1/3, self.bounds.size.width, self.bounds.size.height*1/3)];

        [v setBackgroundColor:[UIColor greenColor]];

//        CAGradientLayer *gradient2 = [CAGradientLayer layer];

//        gradient2.frame = lowerShadow.bounds;

//        gradient2.colors = [NSArray arrayWithObjects:(id)[[UIColor clearColor] CGColor], (id)[[UIColor blackColor] CGColor], nil];

//        [lowerShadow.layer insertSublayer:gradient2 atIndex:0];

        [lowerShadow setUserInteractionEnabled:NO];

        

        [self addSubview:lowerShadow];

    }

 

posted @ 2013-11-30 09:49  AaronGod  阅读(436)  评论(0编辑  收藏  举报