1- How can I connect a “hook” to my system to save an event (for example, “click”)
As already mentioned, you pretty much just add a small piece of the toolkit to the responder / callback for the events you are looking for. You also need to remember what you are doing - your goal here is to collect general actions, not personal information or content. For example, if you are creating a word processing application, you are looking for:
The user clicked the bold button.
NOT
The user made the text "I am Jack's cold sweat." in bold.
2- Where to store statistics on the local computer? (adding plist property?)
Anywhere on the disk, personally, I would not use plist, but rather a special file. OSX convention for specific application files: / Users / * username * / Library / Application support / * application name *
This space is application and user-specific and a great place to store configuration files and all other things specific to your application.
But this is only information from one user, how do you collect this information for different users? On many computers?
3- Is there such a system?
Yes. I created UserMetrix to simplify connecting to new and existing Cocoa applications through the C client or objective-C. UserMetrix collects usage and error statistics from each user, aggregates them and presents them as simple web reports.
source share