小编And*_*ndy的帖子

IB Designables:无法更新自动布局状态:代理引发了"NSInternalInconsistencyException"异常:无法在bundle中加载NIB

我使用stroyboard从xib创建预览,但是我收到了以下错误:

file:///Users/miaios/Desktop/Demo/XibDemo/XibDemo/Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: The agent raised a "NSInternalInconsistencyException" exception: Could not load NIB in bundle: 'NSBundle </Users/miaios/Library/Developer/Xcode/DerivedData/XibDemo-hkqfrktawlqpokczkfobsrmkfxqy/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/XibDemo.app> (loaded)' with name 'HXXibView'

file:///Users/miaios/Desktop/Demo/XibDemo/XibDemo/Base.lproj/Main.storyboard: error: IB Designables: Failed to render instance of HXXibView: The agent threw an exception.
Run Code Online (Sandbox Code Playgroud)

码:

#import <UIKit/UIKit.h>

IB_DESIGNABLE

@interface HXXibView : UIView

@property (nonnull, nonatomic, strong) IBInspectable NSString *text;
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation HXXibView

#pragma mark - Init Methods
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame]; …
Run Code Online (Sandbox Code Playgroud)

objective-c ios ibdesignable

6
推荐指数
0
解决办法
1397
查看次数

标签 统计

ibdesignable ×1

ios ×1

objective-c ×1