jjzjj

Appdelegate

全部标签

ios - 在 URL Scheme OpenURL 之后从 AppDelegate 调用 ViewController 方法

我正在尝试从AppDelegate.m调用ViewController.m中的函数LoadWebpage。我已使用URLScheme启用我的应用程序,以便Safari中的“urlscheme://?querystring”链接打开我的应用程序。我正在AppDelegate中捕获url方案(我可以通过日志记录知道这是有效的)并且想用查询字符串填充全局变量然后调用我的LoadWebPage方法以便ViewController可以使用全局变量并在WebView控件中打开请求的网站。我正在关注thistutorial.这是AppDelegate.m:-(BOOL)application:(UI

ios - 如何控制 appdelegate 中的 View Controller ?

我真的是为简单的问题构造结构。我只是使用以下代码从一个ViewController移动到另一个ViewController。homescreen*home;home=[self.storyboardinstantiateViewControllerWithIdentifier:@"home"];[selfpresentViewController:homeanimated:YEScompletion:nil];尝试在AppDelegate方法中使用相同的代码。UIStoryboard*storyboard;sur=[storyboardinstantiateViewController

iphone - 如何判断收到了哪个本地通知? Objective-C

我有这段代码根据收到的本地通知调用不同的NSLog语句:-(void)application:(UIApplication*)applicationdidReceiveLocalNotification:(UILocalNotification*)notification{if(notification==automaticBackupNotification){NSLog(@"Backupnotificationreceived.");}else{NSLog(@"Didreceivenotification:%@,setfordate:%@.",notification.alertB

objective-c - AppDelegate.m 类中的@interface 错误

应该是我缺少的一个简单解决方案。我有一个选项卡ViewController驱动的应用程序,我想在用户启动或打开该应用程序时对其进行密码保护。我在IB中创建了一个密码类和ViewController。我正在尝试通过以下代码使用AppDelegate.m类applicationDidLoadInForeground方法:-(void)applicationWillEnterForeground:(UIApplication*)application{NSUserDefaults*submissionDefaults=[NSUserDefaultsstandardUserDefaults];

ios - [FIRA_AppDelegate- 消息传递 :didRefreshRegistrationToken:]: unrecognized selector sent to instance - firebase crash issue

我在重新安装iOS应用程序时发现了一个新问题。在重新安装应用程序之前工作正常。在重新安装之前,我更新了cocoasdkrepo,并将Firebase和FirebaseDatabase版本从3.15.0更新到4.0.0版。下面是崩溃日志:-[FIRA_AppDelegate-1495465837867messaging:didRefreshRegistrationToken:]:unrecognizedselectorsenttoinstance0x174661b402017-05-2223:10:58.550969+0800moodfriends[1716:245390]***Term

ios - UITabBarController 以编程方式添加 Controller 导致通知打开时出现问题

以下是我以编程方式将Controller添加到UITabBarController的代码classAppDelegate:UIResponder,UIApplicationDelegate{varwindow:UIWindow?varfirstTabNavigationController:UINavigationController!varsecondTabNavigationControoller:UINavigationController!varthirdTabNavigationController:UINavigationController!varfourthTabNav

ios - UIInterfaceOrientation 总是在 AppDelegate iPad 中返回 Portrait?

我想在iPad应用程序中显示启动画面。在此之前,我想获取当前设备方向的横向或纵向模式。我用过,UIInterfaceOrientationorientation=[[UIApplicationsharedApplication]statusBarOrientation];if(orientation==UIInterfaceOrientationLandscapeRight||orientation==UIInterfaceOrientationLandscapeLeft){splachview=[[UIImageViewalloc]initWithFrame:CGRectMake(0

iphone - iOS - 从 appDelegate 访问 Storyboard上的 viewControllers

我有一个使用CoreData的应用程序,我在应用程序委托(delegate)中创建了一个managedObjectContext。我想将managedObjectContext传递到我的Storyboard上的两个ViewController,以便它们使用相同的managedObjectContext来保存和获取。我可以访问第一个ViewController:self.window.rootViewController但是我想访问的第二个ViewController是在第一个ViewController的segue之后,并且没有从它返回任何引用。我试过:instantiateViewC

ios - 架构 armv7 的 undefined symbol : "_OBJC_CLASS_$_Crashlytics", 从 : objc-class-ref in AppDelegate. o 引用

架构armv7的undefinedsymbol:“_OBJC_CLASS_$_Crashlytics”,引用自:AppDelegate.o中的objc-class-ref我尝试更新Crashlytics(3.3.4)并且还必须更新Fabric,但最新更新存在一些问题。我不知道这里发生了什么。 最佳答案 https://groups.google.com/forum/#!topic/cocoapods/-Rsf5IXN0aM我使用了URL中提到的更改并降级了框架版本,瞧,它工作正常,但需要了解最新版本。

iphone - 在这种情况下,可以一次又一次地重新分配窗口的 rootviewcontroller 吗?

我有一个基于splitviewcontroller的应用程序,但问题是SplitView在两个模态视图之后出现。用于登录对用户有用的其他一些信息。现在我知道splitviewController应该始终是RootViewController。所以我所做的是在我的appDelegate类中创建三个对象。A、B和SplitViewControllerC。导航的顺序是A-->B-->C;所以在应用委托(delegate)中这就是我所做的..self.loginViewController=[[LoginViewControlleralloc]init];self.window.rootVie