iPhone SDK: How to store the time each word was typed?
My problem is twofold: 1) I'm trying to determine an eloquent way to allow the user to type into a UITextView and store the time each word was typed into an array. Th开发者_运维知识库e time will be a float which starts at 0 when the user begins to type. 2) Conversely, I'd like the user to be able to tap on a word in the UITextView and display the time that word was typed (displaying in an NSLog() is fine). Considerations that may throw a wrench into a possible approach -- what if the user goes back to the top of the text and starts typing or to the middle of the text?
Even a suggested approach without code would be appreciated, because right now I'm drawing a blank.
I think you will need to have a delegate for UITextView which implements textView:shouldChangeTextInRange:replacementText:. In there you get every character that the user types. You can get the time/date (using NSDate) and save it when the user starts a word.
精彩评论