2014-09-30 2 views
4

iOS 7에서 훌륭하게 작동하는 앱에는 UIPopoverController가 포함되어 있습니다.이 UIPopoverController는 사용자가 외부에서 탭하면 해제됩니다.UIPopoverController가 iOS 8/Xcode 6에서 닫히지 않음

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

나는 아이폰 OS 8에서 내 응용 프로그램을 실행, 아무런 충돌이없는,하지만 외부 탭하여 팝 오버를 종료하려고 할 때 오류 메시지가 읽기를 나타납니다

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

또한 콘솔 말해 : modalViewController = _myVC ...

iOS 8에서 내 팝업을 벗어날 수 없습니다!

아이디어가 있으십니까?

UPDATE _myVC 코드/w는 :

@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 
+0

'_myVC'의 수명주기는 무엇입니까? 그것은 한 번 이상 제시됩니까? –

+0

_myVC는 단지 한 번만 생성되며 파일의 소유자에 뷰 콘센트가 설정된 xib을 사용합니다. UIButton을 누를 때마다 위의 코드가 실행됩니다. – DanMoore

+0

코드를 표시 할 수 있습니까? 뷰 컨트롤러에서 무언가가 팝 오버를 속이고 있다고 의심됩니다. –

답변

0

나는 모달 프리젠 테이션 몇 가지 문제에 직면했다. 내가하고있는 실수는 viewDidLoad에서 모달로 표현하는 것이 었습니다. viewDidAppear에서 프리젠 테이션을 시도 할 수 있습니다. 이 경우 내 문제가 해결되었습니다.

관련 문제