title: Assigning to ID Nullable from Incompatible Types
body: <p>I have this warning showing up in XCode that I can't seem to get rid of.</p>
  
  <blockquote>
    <p>Assigning to 'id &lt; UINavigationControllerDelegate,  UIImagePickerControllerDelegate > _Nullable '  from incompatibale type 'MyViewController * const _strong'</p>
  </blockquote>
  
  <p>on this line:</p>
  
  <p><code>picker.delegate = self;</code></p>
  
  <p>This line of code causes the application to work as expected. <strong>So removing it, it doesn't work. But I don't know how to get rid of the error. Any help?</strong></p>
  
  <p>Other methods that have delegate assigned are not throwing this warning.</p>
  
  <p>The view controller is a part of a TabBarViewController that is embedded in a NavigationController.</p>
  
  <p>My class inherits the <code>UIImagePickerControllerDelegate</code></p>
  
  <pre><code>@interface MyViewController () &lt;UICollectionViewDelegate, UICollectionViewDataSource, UIImagePickerControllerDelegate, UIActionSheetDelegate, UICollectionViewDelegateFlowLayout&gt; {
  
  }
  ///...
  @end
  </code></pre>
  
  <p>And the complete method.</p>
  
  <pre><code>- (void) showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType {
  
      UIImagePickerController *picker = [[UIImagePickerController alloc] init];
      picker.modalPresentationStyle = UIModalPresentationCurrentContext;
      picker.sourceType = sourceType;
      picker.delegate = self; ///HERE IS THE ISSUE
      picker.modalPresentationStyle = UIModalPresentationFullScreen;
      picker.modalTransitionStyle   = UIModalTransitionStyleCoverVertical;
  
      if (sourceType == UIImagePickerControllerSourceTypeCamera) {
          picker.showsCameraControls = YES;
      }
  
      [self presentViewController:picker animated:YES completion:nil];
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/eecG2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eecG2.png" alt="enter image description here"></a></p>