title: Using both interface builder and code to set autoresizingMask
body: <p>I'm going through a book and one of the challenges are setting the autoresizingMask programmatically.
  The only problem is I can't check if my code is correct because it seems like the setAutoresizingMask: gets overridden by what I set in the IB.</p>
  
  <p>So actually two questions:</p>
  
  <p>1) Is there any way to turn off autoresizingMask in IB? I removed all settings in IB and instead of the code taking over, it seems like Xcode interprets it as autoresizingMask set to default.</p>
  
  <p>2) Are my codes correct? So here's what I did.</p>
  
  <p>In the view controller file...</p>
  
  <pre><code>@property (nonatomic) IBOutlet UISlider *slider;
  </code></pre>
  
  <p>And then I made connection in IB from File Owner to Horizontal Slider and referred to "slider."
  In the app delegate file I have the viewController set as rootViewController.</p>
  
  <pre><code>[viewController.slider setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin];
  </code></pre>
  
  <p>Still when I simulate and change orientation, the width of the slider doesn't change.</p>
  
  <p>Thanks guys!</p>
  
  <p>*<em>*</em> Actually it seems like my codes are wrong somehow... NSLogging autoresizingMask right after setting the code returns 0... Can't seem to figure out what's wrong..</p>