草庐IT

appDeleg

全部标签

javascript - React Native 31,New Appdelegate.m 没有要更改的本地主机 : Network Request Failed

我刚刚升级到react-native的最新版本(31),我的应用程序运行正常,但不再运行了。每次我从fetch中收到NetworkRequestFailed错误。AppDelegate.m已更改,没有要更改的localhost或127.0.0.1。是不是放在别的地方了?AppDelegate.m:#import"AppDelegate.h"#import"RCTBundleURLProvider.h"#import"RCTRootView.h"@implementationAppDelegate-(BOOL)application:(UIApplication*)application

ios - AppDelegate 中的 XMPP 框架代码

我正在努力实现XMPP框架https://github.com/robbiehanson/XMPPFramework在我的应用程序中,我知道会有很多来自XMPPRoom、XMPPIQ、XMPPStream等的代码“方法/委托(delegate)”。我需要知道什么是编写所有这些代码的最佳位置,AppDelegate是XMPP相关代码的最佳候选者? 最佳答案 一个好的做法是创建一个XMPP单例类。因此,您可以在其他类中使用所有公共(public)方法、属性...仅调用共享实例。 关于ios-

ios - 在 AppDelegate.m : "prefix attribute must be followed by an interface or protocol" 中实现协议(protocol)

我正在向AppDelegate添加两个协议(protocol),以便我可以交换RootViewController。我在之前的项目(2个月前)中这样做过,效果很好:@interfaceAppDelegate()@end所以我在今天的项目中做了同样的事情,但是我所有的函数都给出了这个错误:缺少方法声明的上下文所以我尝试了这个:@interfaceAppDelegate()AppDelegate@end现在我明白了Prefixattributemustbefollowedbyaninterfaceorprotocol使AppDelegate.m符合协议(protocol)的正确方法是什么?

ios - NativeScript - Angular 2 自定义 AppDelegate

是否有Angular2方法来完成像this这样的自定义AppDelegate?在NativeScript中?我已经看到了如何在没有Angular的情况下执行此操作的示例,我只是不确定在Angular2中的何处注册AppDelegate。 最佳答案 您可以将其添加到您的ma​​in.ts:importapplication=require("application");import{CustomAppDelegate}from"./custom-app-delegate";if(application.ios{application.

iphone - 我怎么知道 AppDelegate 中的方向发生了变化

设备如何知道方向改变的功能是-(void)viewWillLayoutSubviews和-(void)viewDidLayoutSubviews但是,它们只是在Controller中;现在我想知道在AppDelegate.m文件中是否有类似的函数来了解方向的变化-(void)navigationController:(UINavigationController*)navigationControllerwillShowViewController:(UIViewController*)viewControlleranimated:(BOOL)animated{UINavigation

ios - 有没有办法在不弄乱 AppDelegate 窗口的情况下查看另一个 UIViewController 后面的 UIViewController?

这里有一个我非常喜欢的图书馆(https://github.com/pixyzehn/MediumMenu)。本质上它做了以下事情:后面的菜单其实就是一个UIViewController。如果我们深入研究源代码,我们会发现以下非常重要的代码:publicinit(items:[MediumMenuItem],forViewController:UIViewController){self.init()self.items=itemsheight=screenHeight-80//auto-calculateinitialheightbasedonscreensizeframe=CGRe

ios - 进入Suspended状态后会调用AppDelegate的什么方法?

我的应用程序进入后台,如果我再次打开,它会显示我离开它的同一页面。虽然,如果iOS将应用程序置于暂停状态,但它仍在内存中。如果我回来,将调用哪些AppDelegate方法。实际上我的目的是将相同的屏幕从暂停状态恢复到应用程序,如果它没有被终止的话。最后,如果应用从暂停状态返回,将调用didFinishLaunchWithOptions吗?谢谢.. 最佳答案 作为AppleDocumentation州,application:willFinishLaunchingWithOptions:—Thismethodisyourapp’sfi

ios - 无法从 AppDelegate 调用变量

我的AppDelegate.m中有一个名为message的变量,我想在ViewController中使用它,但它不起作用。我试过这个解决方案:如果我将AppDelegate.m导入我的ViewController.m,我会得到一个错误:clang:error:linkercommandfailedwithexitcode1(使用-v查看调用),但如果我不导入它,我会得到这个:Noknownclassmethodforselector'message'atthisline:self.toSort=[AppDelegate消息];.但是当我将ViewController.m导入AppDel

iphone - iOS 将 ViewController 和 AppDelegate 设置为 CoreLocation 模型类的监听器

如何将AppDelegate和ViewController设置为模型核心定位类的监听器?什么是正确的设计选择??我对拥有一个模型类来实现CoreLocation和位置更新很感兴趣。我猜这个类应该是一个sharedSingleton,因为我的AppDelegate和ViewController都希望访问它。当我的viewController调用它时,我希望CLLocationManager使用startUpdatingLocation。当应用程序进入后台时,我想使用startMonitoringSignificantLocationChanges在AppDelegate中监视位置更新。我

ios - 从 AppDelegate 和标签栏推送 View Controller

我的应用设置了一个标签栏Controller作为RootViewController,每个标签都有一个NavigationController。当执行某些操作时,我希望应用将ViewController推送到屏幕上。其流程是,当应用程序启动或从后台打开时,它会检查存储的NSDate并将其与当前日期进行比较。如果满足正确的条件,它会显示一个UIAlertView。如果我命名为“Push”的按钮被选中,它会运行代码来推送新View。这就是我需要它从AppDelegate运行的原因,因为如果在后台使用该应用程序,则无法保证可以打开哪个选项卡。由于每个选项卡都包含一个NavigationCon