- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
' does not conform to the ' UITabBarControllerDelegate ' protocol"?-6ren"> ' does not conform to the ' UITabBarControllerDelegate ' protocol"?-大家好, 有人知道为什么我会收到附图中的警告吗?在相关代码的正上方是我从一本 Apress 书籍“更多 iPhone 3 开发”中获得的代码的注释。作者试图告诉我一些有关类型转换的信息以消除警告,但我-6ren">
大家好,
有人知道为什么我会收到附图中的警告吗?在相关代码的正上方是我从一本 Apress 书籍“更多 iPhone 3 开发”中获得的代码的注释。作者试图告诉我一些有关类型转换的信息以消除警告,但我不知道如何做到。
"warning: type 'id ' does not conform to the 'UITabBarControllerDelegate' protocol"
我没有在我的应用程序中的任何地方使用标签栏或委托(delegate)。我在使用的两个地方都收到相同的警告:
AV_MonitorAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
获取指向我的应用委托(delegate)的指针。
谢谢。
最佳答案
尝试在赋值之前将其转换为合适的类型,
AV_MonitorAppDelegate *appDelegate = (AV_MonitorAppDelegate *)[[UIApplication sharedApplication] delegate];
关于ios - "warning: type ' id <UIApplicationDelegate> ' does not conform to the ' UITabBarControllerDelegate ' protocol"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4662279/
Xcode 基于模板生成了这个头文件: // this file is XYZAppDelegate.h #import @interface XYZAppDelegate : UIRespond
好的,我正在制作这个 Apple Watch 应用程序,在我的 Watch 应用程序中,我有一个按钮。当您触摸按钮时,它会执行以下操作: [WKInterfaceController openPare
我试图让我的应用程序同时打开多个文件 - 例如选择多个带有文件的应用程序,然后按“在[我的应用程序]中打开”。当我尝试这个时,确实 UIApplicationDelegate openURL 在我的应
抛开最佳实践不谈,如果我创建一个由 UIApplicationDelegate 类拥有的对象,并且在应用程序运行的整个过程中都保持该对象,那么在 UIApplicationDelegate 的 dea
较旧的MonoTouch版本从其模板中添加了以下代码。还需要吗? // This method is required in iPhoneOS 3.0 public override
当从另一个应用程序在一个应用程序中打开文档时,传递给application:openURL:sourceApplication:annotation:的文件名对于显示目的来说是非常荒谬的。此消息的an
我想构建一个静态库来捕获传入的推送通知并使用“aps”命名空间之外的 json 对象。有什么方法可以在不更改 AppDelegate 中的 application:didReceiveRemoteNo
我正在尝试创建一个用于区域监控的插件。区域监控开始正常,但未调用函数 didfinishlaunching 和 didrecievelocalnotification。我不确定为什么会这样。 区域监控
使用 Objective C 运行时,我试图在运行时为我的 iOS 应用程序创建一个 AppDelegate。这仅用于研究目的,我无意发布。 到目前为止我的步骤是: 在运行时创建一个名为 AppDel
我想在显示新 View Controller 时得到通知,UIApplicationDelegate 提供了这种方式,但针对整个应用程序,而不是针对每个 View Controller 每次出现新的
我正在阅读教程,每次单击按钮时,AppDelegate.swift中出现错误,提示线程1信号SIGABRT。 import UIKit @UIApplicationMain class AppDele
在我的 iOS 应用程序中,我想使用 [[UIApplication sharedApplication] delegate] 检索对我的应用程序委托(delegate)的引用,但是这返回类 UABa
关于如何将此数据从我的 iOS AppDelegate.m传递到我的 WatchKit InterfaceController.m 的任何想法? 我在我的 iOS AppDelegate.m 中运行一
从我的代码中的任何位置访问我的应用程序(实现 UIApplicationDelegate 的对象)方法的正确方法是什么? 最佳答案 Caleb 是对的,在下面添加了一个提示,可以节省输入并增加 App
我们如何检测 iOS 应用何时被暂停? 官方UIApplicationDelegate documentation中没有提到这个方法. 这些是 App 可以拥有的状态: (来源:apple.com)
是否有可能符合 UIApplicationDelegate 并成功地在任何类中调用启动/关闭时调用的所有函数?例如,如果我有一个类,在应用程序关闭时保存大量数据是个好主意,但我不想在 App Dele
我想扩展 UIApplicationDelegate 协议(protocol)并为 application(application: UIApplication, didFinishLaunching
我在 XCode 中构建了一个没有任何功能的裸应用程序,并将日志记录语句放在 applicationDidBecomeActive 和 applicationWillResignActive 方法中。
我已使用 CLLocationManager 的 startMonitoringSignificantLocationChanges 将我的应用程序设置为监听重大位置变化。 因此,当设备的位置发生显着
我在 XCode 中构建了一个没有任何功能的裸应用程序,并将日志记录语句放在 applicationDidBecomeActive 和 applicationWillResignActive 方法中。
我是一名优秀的程序员,十分优秀!