草庐IT

APPDELEGATE

全部标签

javascript - React Native - 在 AppDelegate (iOS) 中将事件从 Native 发送到 JavaScript

在我的Reactnative应用程序中,我试图将事件从native代码发送到AppDelegate中的JavaScript。为此,我调用:[self.bridge.eventDispatchersendAppEventWithName:@"EventReminder"body:@{@"name":eventName}];在我的应用委托(delegate)中。当然,要做到这一点,我需要导入:导入“RCTBridge.h”导入“RCTEventDispatcher.h”并合成桥梁@synthesizebridge=_bridge;但在此之后的事件中,桥变量不存在。为了消除这个错误,我让我的

ios - 错误 "_OBJC_CLASS_$_AppDelegate",引用自 :"and error: linker command failed with exit code 1 (use -v to see invocation)"

我是开发新手,我遇到了这个错误,如果我的AppDelegate文件中缺少某些内容,我不会介意,所以我会向您展示这些文件。h文件#import@interfaceAppDelegate:UIResponder@property(strong,nonatomic)UIWindow*window;@endm文件#import"AppDelegate.h"问题是我想我从tem文件中删除了一些东西,但我不记得它是什么这里是完整的错误信息:架构x86_64的undefinedsymbol:“_OBJC_CLASS_$_AppDelegate”,引用自:main.o中的objc-class-refl

ios - 如何在Pod项目ViewController中导入AppDelegate.h文件?

我是POD项目的新手。我想更新pod项目viewControllers,为此我需要访问Pod项目中的AppDelegate类。我已尝试更新Pod配置文件以访问AppDelegate,但未能成功。 最佳答案 您真的不想在您的应用程序和pod之间创建循环依赖关系。推荐的方法是在pod中定义一个协议(protocol)并让您的AppDelegate实现该协议(protocol)。@protocolPodArrayProvider-(NSArray*)arrayToAccess:@end//inAppDelegate.m#import@ex

swift - 如何使用 Swift 从 ViewController 读取 AppDelegate 中的变量值

我想从ViewController中读取包含在AppDelegate中的变量值。该变量包含用于启用iOS推送通知的DeviceToken,我想在UILabel中显示它。到目前为止,这是我的代码:AppDelegate.swiftimportUIKit@UIApplicationMainclassAppDelegate:UIResponder,UIApplicationDelegate{internalvardeviceTokenToPass:String?funcapplication(application:UIApplication,didFinishLaunchingWithOp

ios - testes 函数调用 AppDelegate + managed Object 时单元测试崩溃

我有以下问题:我正在快速编写一个应用程序。我有一个托管对象(称为类别)的类函数(mapCategories),我想对其进行单元测试(XCTest)。myCategoryFunction获取一个NSDictionary并将其内容映射到类别列表[Category]​​中并返回它。要进行映射,我必须使用以下代码创建类别对象:classfuncmapCategories(myDictionary:NSDictionary!)->[Category]{varcategories:[Category]=[]/*...somecodehere.*/letappDelegate=(UIApplicat

ios - 通过桥接 header 导入到 Swift 项目的 Objective C 库只能在 AppDelegate 中看到,而在其他类中看不到

我已经设法通过桥接header在SwiftAppDelegate.swift文件中使用ObjectiveC库。但问题是这个库不能在同一个项目的其他类中使用。这是怎么回事?比如说,枚举成员MMDrawerSide.Left可以在AppDelegate类中成功使用。但是在另一个类中,编译器会提示:Useofunresolvedidentifier'MMDrawerSide'我能做错什么?制作桥接头的步骤非常简单和自动。这是它的内容:#import"MMDrawerController.h"#import"MMDrawerVisualState.h"#import"UIViewControl

ios - 无法在处理 localNotification 操作时从 AppDelegate 发布通知

在我的应用程序委托(delegate)中,我正在尝试设置LocalNotificationActionHandler以执行segue并将通知发送到目标ViewController以触发该类中的函数,但沿线的某个地方未正确发布或接收通知。值得注意的是此时目标ViewController还没有被初始化。这是我目前的代码:来自AppDelegate的片段:funcapplication(application:UIApplication,handleActionWithIdentifieridentifier:String?,forLocalNotificationnotification:

ios - 在 AppDelegate 中自定义 UISearchBar 和 UINavigationBar 的外观?为什么要在类而不是实例级别进行定制?

我正在关注thistutorial.在其AppDelegate中,它有一个customizeAppearance(),其中UISearchBar和UINavigationBar是类型/类属性。它们不应该是我们所在的窗口或当前viewController之类的属性吗?!我们如何才能只向类发送消息,然后让它更改我们的UI?FWIW当我单击cmmd时...显然它只是将它带到类定义中。importUIKit@UIApplicationMainclassAppDelegate:UIResponder,UIApplicationDelegate{varbackgroundSessionComple

ios - Firebase 类型 'AppDelegate' 不符合协议(protocol) 'FUIAuthDelegate'

我正在使用Firebase4.6.0、Xcode9.1、Swift4。当我实现FUIAuthDelegate协议(protocol)及其所需的函数authUI(_authUI:FUIAuth,didSignInWithuser:User?,error:Error?)时,我仍然得到一个编译错误“类型‘AppDelegate’不符合协议(protocol)‘FUIAuthDelegate’”。为什么? 最佳答案 对我来说,这是通过添加方法解决的funcauthUI(_authUI:FUIAuth,didSignInWithuser:Fi

ios - 在 AppDelegate 中模态呈现来自 UITabBarController 的 VC

每次打开应用程序时,我都试图从AppDelegate触发模态视图。我可以看到我的断点被击中,但模式从未显示。我附上了我的Storyboard的图像以防万一。它现在是一个相当简单的应用程序,带有2个选项卡选项卡栏Controller。这是我在AppDelegate中触发它的代码。letnewVC=UIStoryboard(name:"Main",bundle:nil).instantiateViewController(withIdentifier:"LoginView")letview=window?.rootViewControlleras!UITabBarControllervie