我正在开发一个应用程序.在那里我获得了UITableViewCell的所有子视图.
这个代码是:
(void)listSubviewsOfView:(UIView *)view {
// Get the subviews of the view
NSArray *subviews = [view subviews];
// Return if there are no subviews
if ([subviews count] == 0) return;
for (UIView *subview in subviews) {
NSLog(@"%@", subview);
// List the subviews of subview
[self listSubviewsOfView:subview];
}
}
Run Code Online (Sandbox Code Playgroud)
但我的问题是如何找出该子视图列表中的按钮.请告诉我如何解决这个问题.