Pio*_*ski 6 xcode cocoa-touch objective-c ios ibdesignable
我已经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
Run Code Online (Sandbox Code Playgroud)
到目前为止一切都还好,直到今天.我在代码中没有任何改变(我甚至回滚到master分支以确定)并且使用此类的xibs不再在故事板中呈现.
在界面构建器中有信息
Designables:构建失败
但是show按钮什么都不做,以及尝试使用Editor> Debug Selected Views.我无法在班上遇到任何断点.
到目前为止我试过:
它是某种xcode错误还是以某种方式是我的错?除了Debug Selected Views选项之外,是否可以以其他方式调试Designables ?
| 归档时间: |
|
| 查看次数: |
1591 次 |
| 最近记录: |