我有UITableViewCell,我在其中添加一个UIView
内部,我将子视图添加为UIButton
,UIImageView
.
现在我想访问UIView willDisplayCell
.为此我在下面.
NSArray *subviews;
subviews = cell.subviews;
int xxyyzz = 1;
for(id aView in subviews) {
NSLog(@"aView====%@" , [UIView class]);
if([aView isKindOfClass:[UIView class]]) {
NSLog(@"This is UIView... Do what you want to do...");
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当我运行时,我将This is UIView... Do what you want to do...
获得所有子视图(即UIButton,UIImageView等).aView====UIView
我相信这是因为,UIView是所有对象的超类.
UITableViewCell
...