jjzjj

Appdelegate

全部标签

ios - XMPPFramework - 检索与 JID 关联的名称

在Openfire中,用户是使用“用户名”(用作JID的基础)和描述性“名称”创建的。如何在XMPP中检索给定JID的名称?我正在使用XMPPFramework。 最佳答案 您可以使用用户的JID从XMPPUserCoreDataStorageObject中检索用户的显示名称,如下所示:XMPPJID*userJID=@"shakespeare";XMPPUserCoreDataStorageObject*user=[[[selfappDelegate]xmppRosterStorage]userForJID:userJIDxmpp

ios - 如果我们在 App Delegate 的 didFinishLaunching 中返回 NO 会发生什么

这个问题在这里已经有了答案:ReturnTypeof-application:didFinishLaunchingWithOptions:(1个回答)关闭8年前。如果我返回No而不是Yes会发生什么>(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions我已经尝试了两种方法:返回Yes和No但在应用启动时没有得到任何改变。

ios - 在没有 AppDelegate 的 iOS 中收到推送通知时如何获取通知?

我正在为iOS构建用于推送通知的静态库。我如何在无法访问AppDelegate的情况下确定何时收到推送通知?换句话说,我不希望用户调用某些库委托(delegate)以便在收到推送通知时告诉lib。AppDelegate有这个方法didRegisterForRemoteNotificationsWithDeviceToken,如果我可以在调用该方法时收到通知,那将是完美的。我认为NSNotificaitonCenter一定是解决方案,但是没有这样的通知可以通过将观察者添加到NSNotificaitonCenter来接收,它会在收到推送通知时被触发。还是我错了?但是,有一种解决方案,不是我

ios - AppDelegate (iOS) 中的“使用未声明的标识符”

遇到了一些问题。这是我第一次真正处理AppDelegate.h/.m文件。我在AppDelegate.h中声明了一个属性@propertyfloatcenterFreq。然后我在AppDelegate.m中合成它,如下所示:@synthesizecenterFreq=_centerFreq。但是,当我稍后尝试在AppDelegate.m中实际使用centerFreq时,我收到错误“使用未声明的标识符‘centerFreq’”。我不明白为什么我不能在我的.m文件中的任何地方使用这个变量。 最佳答案 foo=self.centerFre

ios - GPPSignInDelegate 的实现是否必须是 ViewController 或 AppDelegate?

我正在尝试按照说明将我用Swift编写的iOS应用程序与GooglePlus集成here.在ViewController中完成所有工作后,我愚蠢地认为我可以将身份验证行为封装在它自己的类中(如下)问题是两个GPPSignInDelegate协议(protocol)函数finishedwithAuth和didDisconnectWithError永远不会被调用。如果我传入一个ViewController或实现GPPSignInDelegate的AppDelegate并将其分配给googlePlus.delegate回调调用成功;当我将self分配给委托(delegate)时,永远不会调用

ios - 无法让 Rdio iOS SDK 播放正常工作

我正在研究Rdio的iOSSDK。我已经在此处概述的“入门”中正确设置了所有内容(http://www.rdio.com/developers/docs/libraries/ios/)。应用程序委托(delegate)中的轨道键在我启动应用程序后起作用并播放。现在我正在尝试让一个简单的UIButton单击来播放轨道,但我终究无法让它正常工作。我在ViewController.h中有这个#import#import@interfaceViewController:UIViewController@property(readonly)Rdio*rdio;@end在ViewControlle

ios - GoogleCloudMessaging 链接错误

我需要在我的应用中使用GoogleCloudMessaging。我通过Cocoapods安装了它。当我添加这部分代码时:GLInstanceIDConfig*instanceIDConfig=[GGLInstanceIDConfigdefaultConfig];instanceIDConfig.delegate=self;//StarttheGGLInstanceIDsharedinstancewiththethatconfigandrequestaregistration//tokentoenablereceptionofnotifications[[GGLInstanceIDsha

iOS 在库中集成推送通知

我正在开发一个静态库,其中包含一些可以在多个应用程序中使用的通用类。此通用代码在接收推送通知时执行某些操作。我可以在库中添加推送通知模块(注册推送、接收推送和处理推送)吗?使用这个库的应用程序会收到推送通知吗? 最佳答案 我认为你可以在你的库中添加注册和处理部分,库的注册方法应该在下面提到的AppDelegate方法中调用-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions并且必

ios - 如何在委托(delegate)中加载插页式广告并在另一个 View Controller 中显示?

我试图在应用程序启动后立即请求Admob插页式广告,因此我尝试在appDelegate.m中实现,但是当我稍后尝试在另一个ViewController中显示它时,我收到一个错误消息,即插页式标识符在此ViewController中找不到。这是我正在使用的代码在AppDelegate.m中@property(nonatomic,strong)GADInterstitial*interstitial;-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launc

ios - 无法导航到 iOS 9 中的其他屏幕

我正在从第二个屏幕导航到第三个屏幕,但显示错误应用程序试图在目标上推送一个零ViewController。这是我用来导航的以下代码,if(appDelegate.thirdViewController==nil){ThirdViewController*sThirdViewController=[self.storyboardinstantiateViewControllerWithIdentifier:@"ThirdViewController"];[appDelegatesetThirdViewController:sThirdViewController];}[self.navi