On Dec 12, 2012, at 4:20 PM, Chuck Soper <chu...@veladg.com> wrote:

> Your message helps a lot. Yesterday, I finally got it working. I had been
> trying to load a custom view with constraints from a nib file into the
> cell of an NSTableView which was inside an NSSplitView. By isolating the
> constraints in my custom view, I discovered the errors I was making. That
> is, I first got my custom view working in the contentView of the window,
> then moved it within the NSSplitView, then moved it within an NSTableView
> (in the NSSplitView).
> 
> I have what I need for now, but I wanted to let you know that I discovered
> with my implementation that I must call
> setTranslatesAutoresizingMaskIntoConstraints:NO for my programmatically
> created subviews or I get lots of constraint exceptions. I also override
> + (BOOL)requiresConstraintBasedLayout to return YES. For my
> NSTableCellView subclass I do not call
> setTranslatesAutoresizingMaskIntoConstraints: or override
> requiresConstraintBasedLayout. My custom view is a subview of my
> NSTableCellView subclass.

That sounds exactly right.

> 
> 
> One more question below...
> 
> 
> On 12/11/12 11:08 AM, "Peter Ammon" <pam...@apple.com> wrote:
>> On Dec 8, 2012, at 4:19 PM, Chuck Soper <chu...@veladg.com> wrote:
>> 
>>> Hi Peter,
>>> 
>>> On 11/27/12 6:33 PM, "Chuck Soper" <chu...@veladg.com> wrote:
>>>> On 11/27/12 2:11 PM, "Peter Ammon" <pam...@apple.com> 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?
>> 
>> For controls that have traditionally positioned their subviews, like
>> NSTableView, NSSplitView, NSTabView, you can think of them as owning the
>> translatesAutoresizingMaskIntoConstraints properties of its subviews, and
>> it will set it appropriately depending on whether the view uses
>> autolayout or not.
> 
> When you say "controls that have traditionally positioned their subviews,
> like NSTableView" is 'their subviews' referring to NSTableCellView but NOT
> a programmatically created subview within NSTableCellView? For my case,
> this was true.

Right, that's what I mean.

> 
> I did read the "Adopting Auto Layout" section in the "Cocoa Auto Layout
> Guide" but I think that I need to re-read the section. The info in the
> "Adopting Auto Layout" section seems critical to developers writing new
> 10.8 applications, and the title and the fact that it's the last section
> of the guide suggests that the info is only applicable to adopting Auto
> Layout for existing apps.
> 

Thanks, that's good feedback.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to