Note that there are some explanatory texts on larger screens.

plurals
  1. POshowImagePicker and ARC
    primarykey
    data
    text
    <p><strong>edit 0</strong></p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.overlayViewController = [[BSsetupOverlayViewController alloc] initWithNibName:@"BSsetupOverlayViewController" bundle:nil] ; // as a delegate we will be notified when pictures are taken and when to dismiss the image picker self.overlayViewController.delegate = self; if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { // camera is not on this device, don't show the camera button NSMutableArray *toolbarItems = [NSMutableArray arrayWithCapacity:self.myToolbar.items.count]; [toolbarItems addObjectsFromArray:self.myToolbar.items]; [toolbarItems removeObjectAtIndex:2]; [self.myToolbar setItems:toolbarItems animated:NO]; } [self showImagePicker:UIImagePickerControllerSourceTypeCamera]; } </code></pre> <p><strong>edit 0</strong></p> <p>The <code>-showImagePicker:</code> code below is almost exactly as copied from the PhotoPicker example, except that the <strong>first</strong> commented-out line is replaced by the line <strong>above</strong> it (because of a deprecated feature). However the new version of the line is producing the warning <code>Warning: Attempt to present &lt;UIImagePickerController: 0x1c53ec70&gt; on &lt;BSsetupViewController: 0x1d888c10&gt; whose view is not in the window hierarchy!</code></p> <p>On the other hand if I replace that <strong>first</strong> commented-out line with the one <strong>below</strong> it, I get the ARC Semantic issue <code>No visible @interface for 'BSsetupViewController' declares the selector 'presentModalViewController:animated:completion:'</code> </p> <p>Any ideas?</p> <pre><code>- (void)showImagePicker:(UIImagePickerControllerSourceType)sourceType { if (self.imageView.isAnimating) [self.imageView stopAnimating]; if (self.capturedImages.count &gt; 0) [self.capturedImages removeAllObjects]; if ([UIImagePickerController isSourceTypeAvailable:sourceType]) { [self.overlayViewController setupImagePicker:sourceType]; [self presentViewController:self.overlayViewController.imagePickerController animated:YES completion:^(void){}]; //[self presentModalViewController:self.overlayViewController.imagePickerController animated:YES]; //[self presentModalViewController:self.overlayViewController.imagePickerController animated:YES completion:^(void){}]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload