- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我一直在浏览关于这个错误的无数帖子:
Undefined symbols:
"_OBJC_CLASS_$_BoxView", referenced from:
objc-class-ref-to-BoxView in ViewMovingViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
BoxView
是UIView
的子类,包含了UIKit
框架。 BoxView.h
已导入到 ViewController 中。
ViewController 包含以下代码:
-(void) addBoxViewAtLocation:(CGPoint)point {
CGRect rect;
rect.origin.x = point.x;
rect.origin.y = point.y;
rect.size.width = 80;
rect.size.width = 40;
BoxView *newView = [[BoxView alloc] initWithFrame:rect];
newView.backgroundColor = [UIColor yellowColor];
[mainView addSubview:newView];
}
BoxView
包含这段代码:
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// no further initialization
}
return self;
}
这是导致错误的行,来自上面的代码:
BoxView *newView = [[BoxView alloc] initWithFrame:rect];
当我在该行中将 BoxView
更改为 UIView
时,错误消失了。有谁知道我需要在这里改变什么?我浏览了很多关于此的帖子,但大多数答案都说它与链接相关,但我尝试勾选和取消勾选某些框但没有成功。我想知道错误是否在我的代码中?如有任何建议,我们将不胜感激!
最佳答案
通常,当 BoxView
的代码没有正确编译到您的目标中时,就会发生这种情况。
您需要确保您正在构建的目标已针对您的 BoxView.m
实现文件选中了相应的框。你的问题表明你已经尝试过这个,但为了清楚起见,这里有一个屏幕截图(来自 Xcode 4)。
“清理并构建”也无妨。
关于objective-c - undefined symbol : "_OBJC_CLASS_$ error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6960543/
体系结构 x86_64 的 undefined symbol :“OBJC_CLASS$_UIPointerShape”,引用自:GoogleMaps 中的 objc-class-ref“OBJC_C
我正在尝试在 Xcode 中编译我的项目。但我收到以下错误。 "_OBJC_CLASS_$_InfrastructureBenchmarkingViewController", referenced
我的通用应用程序遇到问题。我已将 Base SDK 设置为 iPhone 3.2,并将目标设置为 3.1。 我已将使用 UIPopoverController 的文件移至其自己的文件中,并且在 iPh
我在 OS X 10.7.3 (Lion) 中运行 Mac 应用时遇到以下错误: Dyld Error Message: Symbol not found: _OBJC_CLASS_$_NSObj
我已经在我的应用程序中实现了 Reachability.h 类。 当我实现 AddThis对于 iOS,出现此错误: "_OBJC_CLASS_$_ATReachability", reference
我在 BuzzTouch iOS 应用程序中使用 Scringo - 并创建一个存档。它失败并出现以下错误 (null): Ignoring file /Users/rbabu/Desktop/XCo
我正在设备上测试 iPad 应用程序,它给我以下错误: Symbol not found: _OBJC_CLASS_$_NSURL 该应用程序在模拟器上运行良好,但在设备上运行不正常。 最佳答案 通常
我遇到了一件很奇怪的事情。我使用 cocoapods-packager 生成了两个框架,每个框架都依赖于相同的第三方库。当我在我的项目中运行两个框架时,绝对没有问题。但是,当我使用cocoapods整
在开发 iOS 应用程序时,我们不断遇到同样的问题 - 经过一些 git pull/merge 的更改后,我们得到 duplicate symbol _OBJC_CLASS_ 链接器错误 针对不同的类
在互联网上查找此错误的解决方案后,我找到了以下解决方案: 我确保目标已被选中 我确保该文件位于编译源中 我成功了,但仍然有同样的错误: "_OBJC_CLASS_$_NgnEngine", r
请原谅任何小错误,这是我的第一个问题......不过,反馈仍然值得赞赏。 我一直在尝试使用 Redpark 电缆,以便在 iPhone 和 Arduino (Mini Arduino Pro) 之间进
我是 ios developement 的新手。我有一个项目在 ios 5.1 模拟器上运行时它工作正常并且没有收到任何错误但是在同一个项目中运行 ios 6.0 时,ios 6.1 模拟器我收到以下
我已正确导入 CCAvenue 框架并尝试从 CCAvenue 框架调用 InitialViewController 类以启动支付网关服务,但我收到 _OBJC_CLASS_ 错误。 我尝试了很多方法
我从一个正常工作的 UISplitView 应用程序开始为 iPad 创建了一个新应用程序,在新应用程序中我收到了这个错误: "_OBJC_CLASS_$_ConcertListController"
“_OBJC_CLASS_$_AddViewController”,引用自: ContactsController.o 中的 objc-class-ref-to-AddViewController l
我正在使用以下代码获取有关我的 iPhone 的网络信息 - #import #import CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetw
我正在构建一个 ARC iphone 应用程序,并准备集成 addThis ios 库。 我收到以下错误: ld: duplicate symbol _OBJC_CLASS_$_Facebook in
我试图在我的 iOS 应用程序中调用 Firebase Analytics,我在编译项目时遇到错误。 我创建了一个框架,并从该框架调用 firebase 分析,但我不明白以下错误。 Undefined
我在我的项目中使用了“Charts”库来显示堆积条形图。一切正常。图书馆:https://github.com/danielgindi/Charts 现在,我想向我的项目添加工具提示以显示值。 喜欢:
我可能可以编译和构建应用程序,直到我添加这 2 行 geofire 代码,我收到链接器错误 let geofireRef = Database.database().reference().chi
我是一名优秀的程序员,十分优秀!