作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想检查 Cocoa 应用程序中何时移除或重新插入 SD 卡。我怎样才能做到这一点?我尝试使用以下代码,但显示错误:
static void diskAppearedCallback(DADiskRef disk, void* context)
{
CFDictionaryRef description = DADiskCopyDescription(disk);
NSLog(@"Disk appeared: %@", description);
CFRelease(description);
}
int main(int argc, char **argv)
{
DASessionRef session = DASessionCreate(kCFAllocatorDefault);
DARegisterDiskAppearedCallback(session, kDADiskDescriptionMatchVolumeMountable, diskAppearedCallback, 0);
DASessionScheduleWithRunLoop(session, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRunLoopRun();
return 0;
}
这是一个错误:
Undefined symbols for architecture i386:
"_DADiskCopyDescription", referenced from:
_diskAppearedCallback in TestAppDelegate.o
"_DARegisterDiskAppearedCallback", referenced from:
-[TestAppDelegate applicationDidFinishLaunching:] in TestAppDelegate.o
"_DASessionCreate", referenced from:
-[TestAppDelegate applicationDidFinishLaunching:] in TestAppDelegate.o
"_DASessionScheduleWithRunLoop", referenced from:
-[TestAppDelegate applicationDidFinishLaunching:] in TestAppDelegate.o
"_kDADiskDescriptionMatchVolumeMountable", referenced from:
-[TestAppDelegate applicationDidFinishLaunching:] in TestAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
请给我一些建议。提前致谢。
最佳答案
您似乎需要在目标属性中添加 DiskArbitration.framework
。
关于objective-c - 如何在 Cocoa 中通知 SD 卡被移除或重新插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22341197/
我正在做一个项目,我的 android 在这个项目中作为一个网络服务器工作;输入带端口号的 IP 地址,打开 Web 界面,用户可以将文件上传到手机。我想在 Web 界面上显示一些图片,以便我们的界面
我是一名优秀的程序员,十分优秀!