无法插入新的插座连接错误 [英] Could not insert new outlet connection error

查看:127
本文介绍了无法插入新的插座连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个自定义单元格以加载到表格中。接口是完整的,现在我试图链接xib和类。

I have created a custom cell for loading into a table. The interface is complete and now I am trying to link the xib and the class.

我有分割屏幕视图打开,我试图控制拖动项目,使Xcode可以为我做连接。当我填写名称并点击连接时出现错误:

I have the split screen view open and I try to control drag the item so that Xcode can make the connection for me. When I fill in the name and click connect I get an error:


无法插入新的插座连接:无法在URL://localhost/Users/Velox/Projects/CompanyName/ProjectName/ProjectName/HistoryCell.m中将源代码插入到文档中,因为它不包含名为HistoryCell的类的类定义。

Could not insert new outlet connection: Could not insert source code into document at URL://localhost/Users/Velox/Projects/CompanyName/ProjectName/ProjectName/HistoryCell.m because it does not contain a class definition for the class named HistoryCell.

我已将xib的自定义类设置为HistoryCell。

I have set the custom class of the xib to HistoryCell.

我在这里缺少什么?

谢谢。

推荐答案

所以,结果是,我是一个傻瓜。你不能像Xcode这样做。如果您在头文件中手动创建属性,然后在类文件中合成它们,则可以通过执行以下操作来链接:

So, it turns out that I was being a fool. You can't quite do it like this with Xcode. If you create the properties manually in the header file, then synthesise them in the class file, you can then link by doing the following:

打开xib文件
右键单击对象面板中的单元格
单击并从这里的选项拖动到xib上的对象。

Open the xib file Right click on the cell in the "Objects" panel Click and drag from the options here to the objects on the xib.

它。

这篇关于无法插入新的插座连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆