相关疑难解决方法(0)

"无法编译连接:"错误是什么意思?

我从Xcode收到以下错误:

Couldn't compile connection: <IBCocoaTouchOutletConnection:0x401538380
<IBProxyObject: 0x40154a260> => categoryPicker => <IBUIPickerView: 0x4016de1e0>>
Run Code Online (Sandbox Code Playgroud)

我已经将它缩小到故事板中的单个插座连接.我的代码(大约30个具有许多其他连接的视图)编译并运行正常,直到我从UIPicker添加到视图的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
Run Code Online (Sandbox Code Playgroud)

UIPickerView位于UITableViewCell中.这是故事板的图像,从"categoryPicker"到"FiltersTableViewController"的连接导致错误: 在此输入图像描述

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

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

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

    categoryPicker = pickerView;

    return 1;
Run Code Online (Sandbox Code Playgroud)

}

这现在有效!但我想了解为什么连接不起作用以及错误消息的含义.现在这对我来说似乎是一个骗局,因为我在其他地方使用IB连接来获取对象引用.

编辑2:连接原型单元格会产生此错误:非法配置:连接"单元格"不能将原型对象作为其目标.不确定这是否是Xcode 4.5中的新功能.

xcode compiler-errors objective-c storyboard ios

38
推荐指数
2
解决办法
2万
查看次数

标签 统计

compiler-errors ×1

ios ×1

objective-c ×1

storyboard ×1

xcode ×1