调试IBDesignable - 调试所选视图不起作用

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.我无法在班上遇到任何断点.

到目前为止我试过:

  • 清理派生数据
  • 重启x代码
  • 杀死Interface Builder Cocoa Touch Tool
  • 全面重启
  • 项目清理(在之前描述的行动之间)

它是某种xcode错误还是以某种方式是我的错?除了Debug Selected Views选项之外,是否可以以其他方式调试Designables ?

joe*_*els 3

如果您单击“显示报告导航器”,然后查看“界面构建”部分,Xcode 现在会显示 IB 构建错误。

IB 构建错误