I have a simple cocoa application with an editable textfield text1 at the top where the user can enter stuff in as well as a non-editable textfield/label text2 at the bottom which is meant to display exactly what is typed into text1.
My problem is that I can only get text2 to update itself when the user presses enter after he types into text1. Is there any way I can have text2 automatically update itself without the user pressing enter into text1?
Sounds like a job for Cocoa bindings. You could:
NSStringproperty in your model class (which, in simple cases, could be your application delegate);text1to that string property, making sure you select ‘Continuously Updates Value’;text2to that string property.The only step that requires code is step 1. Steps 2 and 3 can be directly configured in the nib file.