ios - 无法插入新的 socket 连接错误

标签 ios objective-c uitableview cocoa-touch uikit

我已经创建了一个用于加载到表格中的自定义单元格。接口(interface)已经完成,现在我正在尝试链接 xib 和类。

我打开分屏 View 并尝试控制拖动项目,以便 Xcode 可以为我建立连接。当我填写名称并单击连接时,出现错误:

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。

我在这里错过了什么?

谢谢。

最佳答案

这个问题似乎是一个 Xcode 错误,当您用同名的新文件替换文件时,它会逐渐出现。 Xcode 似乎保留了对同名旧文件的引用。

无论如何,解决这个问题的方法似乎是——

  1. Clean the project

  2. Click <Your Project> in Project Navigator view. Go to Compile Sources under Build Phases of the target for which you are building. Remove and add back the .m file which is giving you trouble.

  3. Alternatively, in the File Inspector (Utilities view) of the NIB file, under Target Membership, uncheck and check back the target name.

  4. Restart Xcode for good measure.

  5. Of course, deleting and adding back the .m file alone should fix it too.

仅第 1 步和第 2 步就为我修复了它。 随时询问是否需要扩展任何步骤。

欢呼和快乐的编码:)

关于ios - 无法插入新的 socket 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10996023/

相关文章:

ios - 当尝试使用 Int.random() 直接将变量设置为随机整数时,为什么我的程序无法正常工作?

ios - 无效更新 : invalid number of rows in section 0 terminating with uncaught exception of type NSException

ios - [NSString floatValue] 中的浮点值在打印时显示不同的结果

ios - 我想检查 iPhone 已连接 wifi 但路由器未连接到互联网的互联网连接

ios - watchkit , iOS 在 watch 和 iphone 之间发送数据

iphone - Interface Builder 不允许我将 "View"类名重命名为现有类

objective-c - 关于应用内购买

iOS - 当我有助手类时,是否需要 UITableViewCell 委托(delegate)?

ios - 如何让DetailView通过indexPath改变数据

ios - 链接器失败,错误代码为 1