objective-c - "Couldn' t 编译连接 :"error mean? 是什么意思

我从 Xcode 收到以下错误:

Couldn't compile connection: <IBCocoaTouchOutletConnection:0x401538380
<IBProxyObject: 0x40154a260> => categoryPicker => <IBUIPickerView: 0x4016de1e0>>

我已将其缩小到 Storyboard 中的单个 socket 连接。我的代码(大约 30 个具有许多其他连接的 View )编译并运行良好,直到我将 UIPicker 的连接添加到 View 的 categoryPicker 属性。选择器本身也可以正常工作,我无法重新加载它而不使此连接正常工作:

@interface FiltersTableViewController : UITableViewController <UIPickerViewDataSource, UIPickerViewDelegate> {
    NSFetchedResultsController *fetchedResultsController;
    FilterTableViewController *filterView;

    AppDelegate *appDelegate;
    NSManagedObjectContext *managedObjectContext;       
}

@property (nonatomic, strong) FilterTableViewController *filterView;
@property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;

@property (nonatomic, weak) IBOutlet UIPickerView *categoryPicker;

- (void)configureCell:(FilterTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
- (void)performFetch;

@end

UIPickerView 位于 UITableViewCell 中。这是 Storyboard 的图像,从“categoryPicker”到“FiltersTableViewController”的连接会导致错误:

感谢您提供有关如何调试它的任何想法或建议!

编辑: 我删除了连接并在 numberOfComponentsInPickerView 中添加了一行:

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {

    categoryPicker = pickerView;

    return 1;

}

现在可以正常工作了!但我想了解连接无法正常工作的原因以及该错误消息的含义。现在这对我来说似乎是一个杂物,因为我在其他任何地方都使用 IB 连接来获取对象引用。

编辑 2: 连接原型(prototype)单元会生成此错误:非法配置:连接“单元”不能将原型(prototype)对象作为其目标。不确定这是否是 Xcode 4.5 中的新功能。

最佳答案

问题是这是一个原型(prototype)单元。在其中有一个东西的导出是没有意义的,因为它不是一个真正的细胞:它是可能有几十个或数百个细胞的模型,在这种情况下导出会指向哪个?

关于objective-c - "Couldn' t 编译连接 :"error mean? 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9236621/

相关文章:

ios - 如何隐藏/显示导航栏中的右键

objective-c - 核心数据 : error: Failed to call designa

ios - Xcode 8 中的单元测试失败

objective-c - 是否可以将 NSInteger 转换为 NSNumber?

ios - 如何将 NSDate 转换为相对格式 "Today","Yesterday","a we

ios - 为什么 UICollectionView 的 UICollectionViewCell

ios - 显示 UIAlertController 的简单 App Delegate 方法(在 S

iphone - 改变 setContentOffset 的速度 :animated:?

iphone - NSLocale 和国家名称

iphone - 滚动后检测 UITableView 中的当前顶部单元格