UIPopoverController does not decline in iOS 8 / Xcode 6

An app that works great in iOS 7 contains a UIPopoverController that rejects when a user goes beyond it.

UIPopoverController *myPopover = [[UIPopoverController alloc] initWithContentViewController:_myVC];
myPopover.popoverContentSize = CGSizeMake(300.0, 600.0);
[myPopover presentPopoverFromRect:sender.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

When I launch my application in iOS 8, there is no crash, but when I try to exit popover by clicking on it, an error message appears:

attempt to dismiss modal view controller whose view does not currently appear.

the console also tells me that: modalViewController = _myVC ...

I can’t escape my popover in iOS 8!

Any ideas?

UPDATE with code _myVC:

@protocol MyVCDelegate <NSObject>
@optional
- (void)myVCDoneProc:(NSURL *)sender;
- (void)calculateFileLengthConvolve;
- (void)checkConvolveTime;
@end

@interface MyVC: UIViewController <FirstDelegate, SecondDelegate>
{
    UIImageView                 *mDimView;
    UIActivityIndicatorView     *mSpinner;
    IBOutlet UISlider           *mMixSlider;
    IBOutlet UILabel            *mTimeWarningLabel;
    IBOutlet UIButton           *mButton;
}

@property (nonatomic, weak) AudioFilesViewController *AFVC;
@property (nonatomic, strong) IBOutlet UIView *view;
@property (nonatomic, assign) id<UnivConvolutionViewControllerDelegate>delegate;
@property NSString *filePath;


- (void)calculateFileLength;
- (IBAction)process;
- (IBAction)play:(UIButton *)sender;
- (IBAction)stop:(UIButton *)sender;
- (void)checkConvolveTime;

@end

@interface myVC () <UITableViewDelegate, UITableViewDataSource>
@end
@implementation myVC
{
    IBOutlet UITableView        *mImpulsesTableView;
    NSArray                     *mImpulses;
    NSString                    *irPath;
    NSArray                     *userImpulses;
}

@synthesize AFVC = _AFVC;
@synthesize view;
@synthesize delegate;
@synthesize filePath = mFilePath;

- (void)init {
    if(self = [super init]) {
        [[NSBundle mainBundle] loadNibNamed:@"MyVC" owner:self options:nil];

        // create mImpulses
        // set button titles and font, other init... etc.

    }
}

#pragma mark behavior - class methods
// The only view code is in:
- (void)process {
        if (mDimView == nil) {
        mDimView = [[UIImageView alloc] initWithImage:[DimmingImage dimmingImageWithSize:self.view.bounds.size]];
        mDimView.userInteractionEnabled = YES;
        mSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        mSpinner.hidesWhenStopped = YES;
        [mDimView addSubview:mSpinner];
        mSpinner.center = CGPointMake(mDimView.bounds.size.width/2.0f,
                                      mDimView.bounds.size.height/2.0f);
    }

    mDimView.alpha = 0.0f;
    [self.view addSubview:mDimView];
    [UIView animateWithDuration:0.35f animations:^{
        mDimView.alpha = 0.7f;

    } completion:^(BOOL finished) {
        [mSpinner startAnimating];
    }];
}

#pragma mark FirstDelegate & Second Delegate

// FirstDelegate method to remove subviews when processing is complete
- (void)hideActivityView
{
    dispatch_async(dispatch_get_main_queue(), ^{

        [mSpinner stopAnimating];
        [UIView animateWithDuration:0.35f animations:^{
        mDimView.alpha = 0.0f;

    } completion:^(BOOL finished) {
        [mDimView removeFromSuperview];
        }];
    });
}

#pragma mark UITableViewDelegate & DataSource

#pragma mark 

@end
+4
source share
1 answer

. , , viewDidLoad. viewDidAppear. .

0

All Articles