I've got this problem on multiple projects with Xcode4/OS X 10.6:
No matter what I do, the editable NSTextField (containing text "Label") will never stick to the right-edge of the parent NSView.
The immediately adjacent NSTextfield (non-editable, text "Sprint Goal") always resizes correctly - with the ex开发者_JAVA百科act same springs/struts it glues to the right-edge of the parent NSView.
I've got the same generic problem in multiple projects - right-hand-edges of editable NSTextField instances, with floating left-edge, are never, ever honoured. No matter what I do.
Bug? Something fundamental I'm missing here? All my other widgets and controls work "as expected", even with complex layouts. I can't get NSTextField to work even with simple layotus!
Found it!
Possible bug in XCode4, plus human error.
When you single-click an NSTextField, it will sometimes consistently select the item BENEATH that textfield.
In each case in my current project, I had "something" behind the front field - usually a non-editable version of the same field that I was switching back/and forth to based on editable status.
(so I was selecting the NSTextField - but Xcode4 was selecting the item behind it - and then I was making changes to a different item altogether. So, the textfield was retaining its default settings - which are to stick to left, not right)
精彩评论