As noted in a comment on Randall's site, there is an easy way to do this in 10.6 or later:
[self.textView checkTextInDocument:nil];
Depending on how the view is set up, this may do more than just add links—for example it could add smart quotes. You can use setEnabledTextCheckingTypes:
to specify what you want to check. In my case, I want to have smart quotes enabled while typing, but I don't want them added when I'm programmatically changing the text. So I can use something like this:
NSTextCheckingTypes oldTypes = self.textView.enabledTextCheckingTypes;
[self.textView setEnabledTextCheckingTypes:NSTextCheckingTypeLink];
[self.textView checkTextInDocument:nil];
[self.textView setEnabledTextCheckingTypes:oldTypes];
That will return the field to its previous behavior after the links have been added.