Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 有人知道可以用来收集应用程序使用数据的Cocoa/Obj-C库吗_Objective C_Cocoa_Usage Statistics - Fatal编程技术网

Objective c 有人知道可以用来收集应用程序使用数据的Cocoa/Obj-C库吗

Objective c 有人知道可以用来收集应用程序使用数据的Cocoa/Obj-C库吗,objective-c,cocoa,usage-statistics,Objective C,Cocoa,Usage Statistics,我希望能够收集信息,如某些窗口的打开频率、访问用户数据的类型、单击菜单项的频率等。是否有人知道允许我收集这些信息的第三方(开源或商业)Cocoa/Obj-C库或插件 我过去使用过夹点介质,它们与。库的使用非常简单,大约在40分钟内就安装好了。我不知道有哪一个库可以做到这一点,但至少要了解用户何时切换前端应用程序,您可以安装这样的事件处理程序: EventTypeSpec eventType; eventType.eventClass = kEventClassApplication; event

我希望能够收集信息,如某些窗口的打开频率、访问用户数据的类型、单击菜单项的频率等。是否有人知道允许我收集这些信息的第三方(开源或商业)Cocoa/Obj-C库或插件

我过去使用过夹点介质,它们与。库的使用非常简单,大约在40分钟内就安装好了。

我不知道有哪一个库可以做到这一点,但至少要了解用户何时切换前端应用程序,您可以安装这样的事件处理程序:

EventTypeSpec eventType;
eventType.eventClass = kEventClassApplication;
eventType.eventKind  = kEventAppFrontSwitched;
EventHandlerUPP handlerUPP = NewEventHandlerUPP(FrontAppSwitchedDetector_callback);
OSStatus status=InstallApplicationEventHandler(handlerUPP,1,&eventType,self,&_eventHandlerRef);
。。。当收到回调时,您可能会得到当前前端应用程序进程:

pascal OSStatus FrontAppSwitchedDetector_callback(EventHandlerCallRef nextHandler,EventRef theEvent,void* userData)
{
    ProcessSerialNumber newSerial;
    GetFrontProcess(&newSerial);
    //to something with that ....
    return (CallNextEventHandler(nextHandler, theEvent));
}

这似乎是针对Cocoa Touch应用程序,而不是Cocoa应用程序。Hrm,这很有趣,我想他们有时会使用UIKit来监控。。。这是我看到的另一个软件包,同样是基于iPhone的,但是修改它以在mac上工作会很容易。是的,如果Flurry开源他们的库或者让Mac也可以使用它,那就好了。