Jam*_*nay 3 iphone xcode objective-c ios
我一直在使用以下代码遍历我的子视图中的特定类.
for (int i = 0; i < [[self.view subviews] count]; i++) {
if ([[self.view.subviews objectAtIndex:i] class] == [UIButton class]) {
}
}
Run Code Online (Sandbox Code Playgroud)
但我觉得应该有更好的方法.有人可以帮帮我吗?
谢谢.
for(UIView *v in [self.view subviews]) {
if ([v isKindOfClass:[UIButton class]]) {
...
}
}
| 归档时间: |
|
| 查看次数: |
1845 次 |
| 最近记录: |