I have an NSTextField in a Preferences panel. It provides a field to enter a url in.
However, if the user closes the Preferences panel after editing the text in the field, the new value does not get propagated to the User Defaults. This only happens after the user explicitly does Enter or Tab.
This kind of makes the whole approach useless, it seems to me, so I guess I must be doing something wrong?
views:
18answers:
1
+1
A:
I fix this by setting the firstResponder to nil when the window closes.
[[self window] makeFirstResponder:nil];
Nathan Kinsinger
2010-10-28 23:40:51