下面的代码在IOS 5.0,6.0,6.1等上返回"YES",但在IOS 7.0上返回"NO".窦你对此有所了解吗?这是IOS 7.0的错误吗?非常感谢..
[view isKindOfClass:[SimpleLabel class]]
Run Code Online (Sandbox Code Playgroud)
PS:"SimpleLabel"是一个继承自UILabel的类.
---- ----更新
对不起,问题不明确.:(我在UITableViewCell
上课时使用上面的代码,并添加SimpleLabel
如下;
[self addSubview:label];
Run Code Online (Sandbox Code Playgroud)
我重写layoutSubviews
函数,循环self.subviews
,但[view class]
总是返回UITableViewCellScrollView
.
-(void)layoutSubviews {
[super layoutSubviews];
for (UIView*view in self.subviews) {
if ([view isKindOfClass:[SimpleLabel class]]) {
SimpleLabel*label = (SimpleLabel*)view;
Run Code Online (Sandbox Code Playgroud)