Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 显示SFSafariViewController将释放我的NSFetchedResultsController数据_Ios_Objective C_Sfsafariviewcontroller - Fatal编程技术网

Ios 显示SFSafariViewController将释放我的NSFetchedResultsController数据

Ios 显示SFSafariViewController将释放我的NSFetchedResultsController数据,ios,objective-c,sfsafariviewcontroller,Ios,Objective C,Sfsafariviewcontroller,我在我的应用程序中显示链接到文章的网页,但并非所有网页都提供SSL连接。所以我需要实现一个SFSafariViewController来显示网站 在我的iPad界面上,我手动将视图添加到主控制器,但如果我尝试添加SFSafariViewController的视图,我将一无所获 所以我试着用: [[[self parent] navigationController] presentViewController:webView animated:YES completion:nil]; 然而,虽

我在我的应用程序中显示链接到文章的网页,但并非所有网页都提供SSL连接。所以我需要实现一个SFSafariViewController来显示网站

在我的iPad界面上,我手动将视图添加到主控制器,但如果我尝试添加SFSafariViewController的视图,我将一无所获

所以我试着用:

[[[self parent] navigationController] presentViewController:webView animated:YES completion:nil];
然而,虽然这工作得很好,但出于某种原因,我的数据源在之后返回“nil”对象。即使我在调用presentViewController的视图中保留了指向对象的强链接

我的解决办法是关闭所有打开的视图,在关闭SFSafariViewController时重新加载数据集,但这对用户体验不好,因为用户必须一路导航到它们原来所在的位置

我完全不知道为什么我的NSFetchedResultsController在启动SFSafariViewController后都返回“nil”。如有任何提示,将不胜感激

[编辑:] 这是我的主视图控制器的声明。启动SFSafariViewController时,iPad控制器调用此控制器:

@interface DOMainViewController : UIViewController <UINavigationControllerDelegate> {
    id <DOActionControllerProtocol> _actionController;
    MPMoviePlayerViewController* _moviePlayerViewController;
    UINavigationController* _navigationController;

}
SFSafariViewController* webView = [[SFSafariViewController alloc] initWithURL:link];
[webView setDelegate:self];
[[[self parent] navigationController] presentViewController:webView animated:YES completion:nil];
DOiPadController定义如下,其中重新显示的s=视图存储在_viewControllers中

@interface DOiPadActionController : NSObject <DOActionControllerProtocol, SFSafariViewControllerDelegate> {
@private
    DOMainViewController* __weak _parent;

    NSMutableArray* _viewControllers;
    NSMutableArray* _oldViewControllers;

    int _firstViewX;
    int _previousTranslation;
    CGPoint _translatedPoint;

    bool _bouncedLeft;
    bool _bouncedRight;
    bool _overruleBounce;

    //Need to be able to enable and disable.
    UIPanGestureRecognizer *_panRecognizer;
}
@接口DOiPadActionController:NSObject{
@私人的
DOMainViewController*\uu弱\u父级;
NSMutableArray*_视图控制器;
NSMutableArray*_oldViewController;
int_firstViewX;
int_先前的翻译;
CGPoint _translatedPoint;
布尔(bool_)左跳;;
bool_反弹光;
波尔否决了弹跳;
//需要能够启用和禁用。
UIPANGESTURE识别器*\U装甲识别器;
}
当不再需要时,我从那里释放视图控制器,并在需要时添加新的视图控制器。这样可以将视图从视图中分割出来


在iPhone应用程序中,我使用导航控制器查看视图,似乎没有问题。

您发布的一行代码没有告诉我们任何可以帮助您的信息。请给我们更多的信息。例如FRC所在的位置以及它与显示
SFSafariViewController
的关系。我不确定是否理解“并非所有人都提供SSL连接。因此我需要实现SFSafariViewController来显示网站”。在iOS 9中,无法在UIWeb中显示不安全的内容(除非您覆盖它)。我可以重写它,但这只是我所期望的一个临时解决方案。我添加了一些有关应用程序结构的更多信息。您没有向我们提供任何相关的代码,只是一些带有大量变量的声明,这些变量似乎与问题完全无关。请提供一份