• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can't remove autoresizing constraints?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't remove autoresizing constraints?


  • Subject: Re: Can't remove autoresizing constraints?
  • From: Kyle Sluder <email@hidden>
  • Date: Wed, 27 Nov 2013 07:36:13 -0800

> On Nov 26, 2013, at 9:56 PM, Rick Mann <email@hidden> wrote:
>
> In my ongoing experimentation with getting a fixed view above my table view, I'm trying to do what I did successfully in the days before autolayout: separate the UITV's view and tableView properties. This works, but I can't figure out how to make it work with autolayout constraints.
>
> The problem is that IB/iOS create autoresizing mask constraints on the table view. By the time I can setTranlates to NO, it's too late, the constraints are made. So I try to remove them in -viewDidLoad, by calling:
>
> [self.tableView.superview removeConstraints: self.tableView.constraints]
>
> But this has no effect. I tried calling it on self.tableView, as well. The constraints are still there after removal.
>
> I'm doing this in an attempt to programmatically create constraints for both the table view and the banner view that live within a programmatically-created UIView.
>
> I need the constraints because the banner slides in from the top when shown, and slides out when hidden (this part is currently working with the view container solution I have).

The timing of the addition and removal of autoresizing mask constraints is not documented. Experimentally, one can deduce that this is done during the updateConstraints phase on the Mac, but there might be other times at which this happens.

Either way, the relationship between a UITVC's view and tableView is not yours to modify. In the time you've spent trying to hack this, you could have moved your cells to XIBs and implemented a static data source in your own banner-and-table-view presenting view controller.

--Kyle Sluder

_______________________________________________

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


  • Prev by Date: Re: iTunes Parental Preferences doesn't change on editing plist file on Mavericks OS X
  • Next by Date: Re: NSTask and 10.9 [SOLVED]
  • Previous by thread: Re: iTunes Parental Preferences doesn't change on editing plist file on Mavericks OS X
  • Next by thread: Preferences caching?
  • Index(es):
    • Date
    • Thread