作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 NSMutableDictionary 来存储 4 次触摸的 X 和 Y 值,如 Apple 的事件处理指南 ( http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/Introduction/Introduction.html ) 中所示
我的代码是:
- (void)cacheBeginPointForTouches:(NSSet *)touches {
if ([touches count] > 0) {
for (UITouch *touch in touches) {
CGPoint *point = (CGPoint *)CFMutableDictionaryGetValue(_TouchesDict, touch);
if (point == NULL) {
point = (CGPoint *)malloc(sizeof(CGPoint));
CFDictionarySetValue(_TouchesDict, touch, point);
}
*point = [touch locationInView:_view.superview];
}
}
}
但是,我不断收到如下编译器错误:
Undefined symbols for architecture i386:
"_CFMutableDictionaryGetValue", referenced from:
-[ViewController cacheBeginPointForTouches:] in ViewController.o
"_OBJC_IVAR_$_UIViewController._view", referenced from:
-[ViewController cacheBeginPointForTouches:] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有人对我可能做错的事情有什么建议吗?
谢谢!
最佳答案
将CFMutableDictionaryGetValue
替换为CFDictionaryGetValue
。CFMutableDictionaryGetValue 函数对我来说似乎很奇怪。我认为它不存在
关于ios - 编译器错误 - MultiTouchEvents 的 NSMutableDictionary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17994973/
我正在尝试使用 NSMutableDictionary 来存储 4 次触摸的 X 和 Y 值,如 Apple 的事件处理指南 ( http://developer.apple.com/library/
我是一名优秀的程序员,十分优秀!