Auto Layout: Aqua space to view's superview unresolvable without using |

Originator:lithium3141
Number:rdar://13591245 Date Originated:05-Apr-2013 04:33 PM
Status:Open Resolved:
Product:OS X SDK Product Version:OS X 10.8.3 (12D78)/Xcode 4.6.1 (4H512)
Classification:Other Bug Reproducible:Always
 
05-Apr-2013 04:33 PM Tim Ekl:
Summary: When specifying an array of NSLayoutConstraint instances using the visual format, a default Aqua space between a view and its immediate superview is unresolvable if the superview is referenced by name, instead of with the pipe (|) character.

Steps to Reproduce:
1. Create a new Cocoa application
2. Instantiate a button programmatically
3. Turn off translatesAutoresizingMaskIntoConstraints on the button
4. Add the button as a subview of the main window's content view
5. Add a constraint between the button and the main window's content view with the visual format: @"[contentView]-[button]"

Expected Results: The Auto Layout system interprets [contentView] as referring to the button's immediate superview and produces the appropriate Aqua space constraint.

Actual Results: The Auto Layout system logs an error:

2013-04-05 16:25:21.494 AquaSpaceSuperviewTest[97459:303] *** Assertion failure in -[NSLayoutConstraint constant], /SourceCache/Foundation/Foundation-945.16/Layout.subproj/NSLayoutConstraint.m:529
2013-04-05 16:25:21.495 AquaSpaceSuperviewTest[97459:303] Theme <NSAquaUserInterfaceTheme: 0x1021405d0> was unable to resolve symbolic constant <NSLayoutConstraint:0x10213eb90 H:[NSView:0x102124470]-(NSSpace(unresolvable))-[NSButton:0x10211d620'Button']> in constraint (null)

Regression: Unknown.

Notes: A sample app is forthcoming.




05-Apr-2013 04:38 PM Tim Ekl:
Sample app attached; to reproduce the problem, simply run the app, note the placement of the button, and observe the console output. A contrasting implementation is also provided that uses the superview | placeholder; to see the difference in behavior, change the value of CONSTRAIN_USING_SUPERVIEW_PLACEHOLDER to 1.

05-Apr-2013 04:38 PM Tim Ekl:
'AquaSpaceSuperviewTest.zip' was successfully uploaded

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!