当我按build+debug时,出现了以下错误:

ld: duplicate symbol .objc_class_name_BlogTableItemCell in /Users/fabian/Development/Workspaces/iphone_experiments/xcode_build_output/MausLog.build/Debug-iphonesimulator/MausLog.build/Objects-normal/i386/BlogTableItemCell-3733583914888A7B.o and /Users/fabian/Development/Workspaces/iphone_experiments/xcode_build_output/MausLog.build/Debug-iphonesimulator/MausLog.build/Objects-normal/i386/BlogTableItemCell-3733583914888A7B.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

推荐答案

似乎在代码的不同位置两次编译同一个BlogTableItemCell类.在以下情况下可能会发生这种情况.

  • 你把同一个班级

  • 实际上你只有一个

试着在整个项目中找到你的班级,确保你的项目中只有一份副本.

Objective-c相关问答推荐

如何获取 NSDictionary 中的第一个元素?

在 Objective-C 中定义协议的类别?

目标 C:在不离开应用程序的情况下发送Electron邮件

如何将 NSDate 转换为今天、昨天、一周前、一个月前、一年前等相对格式?

UITableView - Select 了哪一行?

如何删除 xcode 5 中的旧配置文件?

以编程方式创建 UITableView

iPhone - 什么是重用标识符(UITableViewCell)?

UIViewController 的 prefersStatusBarHidden 不起作用

从 iPhone 设备查找当前国家

如何从 UIGestureRecognizer 获取 UITouch 位置

NSAssert vs assert :您使用哪个,何时使用?

100% 不透明度 UILabel 超过 50% 不透明度背景(UIView?)

-fembed-bitcode 在 6.0 之前的 iOS 版本上不受支持

发送通知到山狮通知中心

重复符号问题

哪个是正确的,nil 或 NULL,来标记没有 Objective-C 块?

无法在 iOS7 上将 UITextField 添加到 UIAlertView ...在 iOS 6 中有效

iOS 上的电话号码格式

公开只读但具有私有设置器的 Objective-C 属性