You seem to be changing the applied stroke of the text itself (and perhaps it's notshowing because it doesn't have a color).
Try changing the underline style and pattern, as in this sample, found through Google: http://cocoadev.com/wiki/CustomSpellingView
I agree that the NSStrokeColorAttributeName is not the correct property to use. I am not able to edit my post to remove that piece of code.
I am trying to do this for my iOS project and NSUnderlineColorAttributeName is not available for iOS yet. It is only available for OSX. I just checked that in the developer library.
Am I missing something here?
Also, I am unable to add a "dotted" underline. All I can do is put a single line under the text. is Apple allowing us to only put a single line and not any of the other types of underline styles such as dashed, dotted etc.?