访问对象方法比较

    //这种写法明显不如下面的写法安全
//    [[self.staticDragViews objectAtIndex:dragView.tag] setAlpha:0.5];
    
//安全的写法 TKDragView
*staticDragView = (TKDragView*)[self.staticDragViews objectAtIndex:dragView.tag]; if (staticDragView)[staticDragView setAlpha:0.3];

 

你可能感兴趣的:(对象)