I wouldnt like to use global variables but I do not know enough cocoa and objective-c to get along without them. Still cant understand how to get this to work
Stephen
Let me preface all this with the warning that I don't really know what I'm doing yet, so please filter my ideas with the appropriate degree of skepticism. My instinct is to set up a custom NSObject to keep an eye on your NSTextField that would store those values as iVars. It would be the delegate object of your textField so would receive notifications such as textDidChange:. In that method you could put in the logic to calculate the number of words, store them in your iVars and then update your labels appropriately.
My concern with this approach is that your method is going to be constantly getting called as someone is typing and may cause performance issues, or it may not (I simply don't have enough experience with this stuff to know). A solution that might be possible would be creating a delay mechanism using NSTimer or something like that that would only execute the "meat" of your method after a short delay, but all of this is just me speculating. I know this kind of thing must have been figured out many times, you might want to check out the mailing lists and such to see if you can't find a more sophisticated solution from someone smarter than myself.
The other solution I thought of would be creating a separate thread to handle those updates so that it won't slow down the typing performance. I haven't learned about threading yet (except enough to realize that I'm going to avoid dealing with that mess for as long as I can get away with) so I can't offer much help in that department except to point you to the Apple Docs.