下面的行 ( myScrollView.delegate = self;
) 是一个警告:Local declaration of 'myScrollView' hides instance variable
。我的问题是,为什么会这样?
我的视图控制器.h
@interface myViewController : UIViewController
{
UIScrollView *myScrollView;
}
我的视图控制器.m
UIScrollView *myScrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
myScrollView.delegate = self; // Warning: Local declaration of 'myScrollView' hides instance variable