title: Custom UIActionSheet with UIDatePicker gives error "invalid context 0x0"
body: <p>I'm trying to display a UIDatePicker in an iPad/iPhone application and I'm using a UIActionSheet with a UIDatePicker embedded within. When I'm testing the app with iOS 7 Simulator I'm getting the following error:</p>
  
  <pre><code>&lt;Error&gt;: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
  </code></pre>
  
  <p>I get the same error for <code>CGContextSetStrokeColorWithColor</code>, <code>CGContextSaveGState</code>, <code>CGContextSetFlatness</code> and a bunch of other similar <code>CGContext___</code> types.</p>
  
  <p>What is strange is that I'm not getting this error when testing in iOS 6.1 Simulator.</p>
  
  <p>I'm still new to iOS development so I'm wondering if modifying a UIActionSheet with custom views is something that Apple strongly advises against. If yes what other options do I have to display a UIDatePicker in a modal manner?</p>
  
  <p><strong>Update</strong></p>
  
  <p>As mentioned below, I've found an explanation for the error in Apple's documentation for UIActionSheet; it's pretty clearly explained the UIActionSheet <strong>is not</strong> to be subclassed and used to display subviews. </p>