Data Detectors in Cocoa
问题 I want to add a data detector in an NSTextField / NSTextView like in Mail (e.g. date, email, URL, etc). Does anyone have an idea how to do this ? I think I saw it in TextEdit's source code but when I checked it was 2005's version and I can't find the new source code. Alex 回答1: You need to set the formatter outlet of the object. Built in formatters are NSDateFormatter and NSNumberFormatter. You can define custom formatters by extending the NSFormatter class. There is a chapter in Aaron