ios – 调试IBDesignable – 调试所选视图不起作用
发布时间:2020-12-14 19:09:26 所属栏目:百科 来源:网络整理
导读:我已经为接口视图中的IBDesignables xib做了可重用的类. @interface ReusableView ()@property (nonatomic,strong) UIView *contentView;@end@implementation ReusableView- (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame
|
我已经为接口视图中的IBDesignables xib做了可重用的类.
@interface ReusableView ()
@property (nonatomic,strong) UIView *contentView;
@end
@implementation ReusableView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
[self setupXib];
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
[self setupXib];
return self;
}
- (void)setupXib {
self.contentView = [self loadFromNib];
self.contentView.frame = self.bounds;
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self addSubview:self.contentView];
}
- (UIView *)loadFromNib {
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:bundle];
UIView *view = (UIView *)[[nib instantiateWithOwner:self options:nil] firstObject];
return view;
}
@end
到目前为止一切都还好,直到今天.我在代码中没有任何改变(我甚至回滚到master分支以确定)并且使用此类的xibs不再在故事板中呈现. 在界面构建器中有信息
但是show按钮什么都不做,以及尝试使用Editor>调试所选视图.我无法在班上遇到任何断点. 到目前为止我试过: >清理派生数据 它是某种xcode错误还是以某种方式是我的错?除了使用Debug Selected Views选项之外,是否可以以任何其他方式调试Designable? 解决方法
如果单击“显示报表导航器”然后查看“接口构建”部分,Xcode现在会显示IB构建错误.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |

