草庐IT

FIRA_AppDelegate

全部标签

iphone - Xcode "AppDelegate *const __strong' 到不兼容类型的参数”错误

当我如下声明appDelegate接口(interface)以设置NSXMLParserDelegate时,我从其他使用[[UIApplicationsharedApplication]delegate]的View收到一些警告;@interfaceAppDelegate:UIResponderwarning:Initializing'AppDelegate*__strong'withanexpressionofincompatibletype'id'但是,如果我删除它,由于xmlParser的self设置会出现另一个警告,@interfaceAppDelegate:UIResponde

ios - 从 Appdelegate 访问 UITabBarController

我正在尝试从UIWindow中的UIViewController访问我的UiTabBarController,因为它不属于UITabBarController-使用self.tabBarController..将不起作用,因为它将为nil。所以我尝试了这段代码:BBAppDelegate*appDelegate=(BBAppDelegate*)[[UIApplicationsharedApplication]delegate];UITabBarController*tabBarController=appDelegate.window.rootViewController.tabBar

iOS 推送通知和 AppDelegate 方法行为

我对许多stackoverflow问题和网站进行了一些研究,试图弄清楚iOS推送通知如何影响AppDelegate生命周期方法以及何时触发(不)哪个方法。研究的主要重点是“标准”iOS推送通知(带有alert字段)和静默通知(仅content-available设置为1)和AppDelegate的application:didReceiveRemoteNotification和application:didFinishLaunchingWithOptions方法。我不想针对不同的场景提出很多问题,而是想尝试写下我尝试过的不同测试用例的陈述,然后再问你:Isthereanystateme

iphone - 如何在不传递委托(delegate)的情况下从 RootViewController 调用 AppDelegate 方法?

如何在不传递委托(delegate)的情况下从RootViewController调用AppDelegate方法?只是想知道是否有办法做到这一点?(或者我是否需要在RootViewController中创建一个委托(delegate)对象来保存对AppDelegate的引用) 最佳答案 [[[UIApplicationsharedApplication]delegate]someMethod];像魅力一样工作! 关于iphone-如何在不传递委托(delegate)的情况下从RootVi

iphone - 如何从 AppDelegate 获取 navController。

我想知道,如何在iPhone编程中从AppDelegate=[[UIApplicationsharedApplication]delegate]获取navController。例如,在我们引用AppDelegate的其他viewController中。在applicationDelegate.h中我们有:UINavigationController*navController;以及applicationDelegate.m中的以下内容-(void)applicationDidFinishLaunching:(UIApplication*)application{[windowaddSu

iphone - 使用 AppDelegate 共享数据

我找到了一些资源,它们解释了如何使用AppDelegate在iOS应用程序中的对象之间共享数据。我已经毫不费力地实现了它,在我的情况下它看起来是一个很好的方法。考虑使用AppDelegate可以做什么,我想知道应该在哪里画线。显然还有其他方法可以sharedataacrossviewcontrollers,使用Singletonobjects,和NSUserDefaults.什么时候使用AppDelegate共享数据合适?在我目前的情况下,我使用这种方法来存储用于推送通知的appleDeviceToken。当用户登录或注销应用程序时,我会使用该token。在MyAppDelegate.

ios - 与初始 View Controller 的 View 生命周期方法相关的 appdelegate 方法何时被调用?

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。问题必须表现出对正在解决的问题的最低限度的理解。告诉我们您尝试过的方法、为什么不起作用以及它应该起作用。另请参阅:StackOverflowquestionchecklist关闭9年前。Improvethisquestion当您的应用程序加载时,调用的方法顺序是什么,尤其是对于这些方法:applicationDidFinishLaunchingviewDidLoadviewWillAppearapplicationDidBecomeActive从Nib醒来

swift - 从 UIApplicationShortcutItem 触发的 AppDelegate 导航到 ViewController

在我的应用程序中,启动的第一个View由RootUIViewController控制。现在用户可以点击此View上的任何按钮,然后segue到由LeafUIViewController控制的View。每个按钮都指向同一个View,其中一些参数具有不同的值。现在我已经实现了3DTouch快捷菜单,它在AppDelegate中正确调用了以下函数:funcapplication(application:UIApplication,performActionForShortcutItemshortcutItem:UIApplicationShortcutItem,completionHandl

objective-c - AppDelegate 和 MainViewController iOS 如何共享数据?

我有一些MyData类。MyData依赖于AppDelegate。(我在AppDelegate中有一个MyData对象)我想在MainViewController中使用MyData,为此,我很惭愧地在MainViewControllerAppDelegate。我是初学者开发者,而不是iOS开发者。在MainViewController中,如何在不导入Appdelegate的情况下获取MyData(在AppDelegate中初始化)? 最佳答案 将您的MyData类设为单例。Singleton的目的是控制对象的创建,将对象的数量限制为

swift - 将 NSTextField 对象连接到 AppDelegate.swift 中的 IBOutlet

最近在努力学习Swift,如果这个问题看起来比较简单,请多多包涵。出于某种原因,在选项卡ViewController中按住NSTextField对象并拖动并不会给我“插入socket或操作”的选项,而是在我滚动兼容对象时“连接绑定(bind)”(在在这种情况下,它是父类(superclass)声明)。为什么我无法插入socket或Action,但可以连接绑定(bind)?附带问题:什么是绑定(bind)? 最佳答案 导出只能是您的nib文件/Storyboard场景所有者的属性(property)。在大多数情况下,哪个是您的View