我试图在com.apple.scheduler plist中获取repeatInterval键的值.我想像这样使用NSDictionary的valueForKeyPath:方法:
CFPropertyListRef value;
value = CFPreferencesCopyValue(CFSTR("AbsoluteSchedule"),
CFSTR("com.apple.scheduler"),
kCFPreferencesCurrentUser,
kCFPreferencesCurrentHost);
NSNumber *repeatInterval = [(NSDictionary *)value valueForKeyPath:@"com.apple.SoftwareUpdate.SUCheckSchedulerTag.Timer.repeatInterval"];
Run Code Online (Sandbox Code Playgroud)
但问题是第一个键实际上是"com.apple.SoftwareUpdate",而不仅仅是"com".我可以通过单独获取第一个值来解决这个问题:
NSDictionary *dict = [(NSDictionary *)value valueForKey:@"com.apple.SoftwareUpdate"];
NSNumber *repeatInterval = [dict valueForKeyPath:@"SUCheckSchedulerTag.Timer.repeatInterval"];
Run Code Online (Sandbox Code Playgroud)
我只是想知道是否有办法在一个密钥路径中逃避时期,这样我就可以消除这个额外的步骤.
操作系统:OS X Mavericks (v10.9)
保险丝:OSXFUSE v2.6.2
$ make
cc -D_FILE_OFFSET_BITS=64 -I/usr/local/include/osxfuse/fuse -Wall -g -F/Library/Frameworks -o loopback loopback.c -losxfuse
ld: library not found for -losxfuse
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [loopback] Error 1
Run Code Online (Sandbox Code Playgroud)
尝试编译boxfs2也会产生这个错误:
$ make
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package …Run Code Online (Sandbox Code Playgroud) 我正在为OS X编写一个应用程序,我需要从日志中获取消息以发送回我们的服务器进行分析/故障排除.我知道我可以使用Apple系统日志(ASL)功能来获得我想要的功能,但是只想获取当前会话的日志消息.我可以在AppDelegate init方法中占用时间:
// now minus one second
NSDate *startTime = [NSDate dateWithTimeIntervalSinceNow:-1];
Run Code Online (Sandbox Code Playgroud)
但是想知道系统是否可以更准确地记录应用程序的启动时间.我查看了NSProcessInfo,但没有看到任何相关内容.有没有办法确定一个进程的开始时间,而不仅仅是在应用程序本身记录时间?