我无法连接到文件的所有者 XIB。应用程序类型是通用的。在“引用网点”的文件所有者中,只有“新引用网点”,而在“引用网点集合”下,只有“新引用网点集合”。不可能将 UIImageView 的 IBOutlet 连接到 xib。在文件的所有者中没有出现 UIImageView 的导出,尽管我合成了它。这是代码:
在 RootViewController.h 中
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController <UIGestureRecognizerDelegate>{
}
@property (nonatomic, copy) IBOutlet UIImageView *imageView;
@property (nonatomic, assign)BOOL fromRootViewController;
- (void)handleTap:(UITapGestureRecognizer *)recognizer;
@end
在 RootViewController.m 中
@interface RootViewController ()
@end
@implementation RootViewController
@synthesize imageView;
@synthesize fromRootViewController;
在RootViewController_iPhone.xib和RootViewController_iPad.xib中没有出现UIImageView的Outlet。
当我运行应用程序时,这是一个错误:
NSInternalInconsistencyException。无法在 Bundle 中加载 NIB:NSBundle
我该怎么办?提前致谢
最佳答案
打开 IB 和文件的所有者并查看自定义类,检查类名是否引用 XIB 是正确的,或者它是否表示通用 NSObject,在这种情况下, 修复它。
关于ios - 在文件的所有者中不要出现 Outlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12685744/