Re: split views, best practices for 10.8?
Re: split views, best practices for 10.8?
- Subject: Re: split views, best practices for 10.8?
- From: Chuck Soper <email@hidden>
- Date: Tue, 11 Dec 2012 10:34:28 -0800
- Thread-topic: split views, best practices for 10.8?
On 12/8/12 11:43 PM, "Kyle Sluder" <email@hidden> wrote:
>On Sat, Dec 8, 2012, at 04:19 PM, Chuck Soper wrote:
>> On 11/27/12 6:33 PM, "Chuck Soper" <email@hidden> wrote:
>> >On 11/27/12 2:11 PM, "Peter Ammon" <email@hidden> wrote:
>> >
>> >>Hi Chuck,
>> >>
>> >>Autolayout works well with NSSplitView in 10.8.
>> >
>> >Perfect. Thanks for that confirmation.
>>
>> Does that mean that in 10.8 (and not 10.7) that it's fine to call
>> setTranslatesAutoresizingMaskIntoConstraints:NO for subviews of
>> NSSplitView?
>
>It is never(*) correct to call
>-setTranslatesAutoresizingMaskIntoConstraints: on a view for which you
>do not control the superview's implementation.
Never? The documentation for setTranslatesAutoresizingMaskIntoConstraints:
says, "You should call this method yourself for programmatically created
views." This means that programmatically created views cannot be added to
NSSplitView, NSTableCellView and other common container views.
The outcome of this is that I need to avoid NSSplitView, NSTableCellView,
etc. so that I can load (and reload) a custom view from a nib file.
Instead, I'll need to implement my own split views using constraints and
not rely on NSSplitView. I must call
setTranslatesAutoresizingMaskIntoConstraints:NO for my programmatically
created views.
>On 10.8, NSSplitView should be calling
>-setTranslatesAutoresizingMaskIntoConstraints: already.
>
>> And, that NSSplitView won't add constraints that conflict with my
>> subviews?
>
>This should be the case.
NSTableView does add constraints that conflict with my subviews. Is
NSSplitView different? And did that difference happen in 10.8?
>>
>> The "Cocoa Auto Layout Guide" says not to call
>> setTranslatesAutoresizingMaskIntoConstraints:NO for subviews of
>> NSSplitView, but I think that's for 10.7 and the statement is no longer
>> true for 10.8. Is that correct?
>
>See above.
Being able to call setTranslatesAutoresizingMaskIntoConstraints:NO for
subviews of
NSSplitView would allow me to add programmatically created views to an
NSSplitView instance. I think that NSSplitView in 10.8 works better with
subviews with constraints (than 10.7), but I haven't been able to confirm
this from the documentation.
Chuck
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden