草庐IT

FIRA_AppDelegate

全部标签

iphone - remoteControlReceivedWithEvent 未在 appDelegate 中调用

我在使用avplayer控制iPhone控件时遇到问题。如果我输入函数-(void)remoteControlReceivedWithEvent:(UIEvent*)event在负责播放所调用函数的ViewController中,但前提是我要在当前ViewController中返回后台。如果我要从其他ViewController进入后台,则该函数永远不会被调用。这就是为什么我想把它放在应用程序委托(delegate)中。我尝试了Becomefirstresponse并将该函数放入每个ViewController中,但它确实有帮助。我也打电话[[UIApplicationsharedAp

iphone - remoteControlReceivedWithEvent 未在 appDelegate 中调用

我在使用avplayer控制iPhone控件时遇到问题。如果我输入函数-(void)remoteControlReceivedWithEvent:(UIEvent*)event在负责播放所调用函数的ViewController中,但前提是我要在当前ViewController中返回后台。如果我要从其他ViewController进入后台,则该函数永远不会被调用。这就是为什么我想把它放在应用程序委托(delegate)中。我尝试了Becomefirstresponse并将该函数放入每个ViewController中,但它确实有帮助。我也打电话[[UIApplicationsharedAp

iphone - 从不兼容类型 'AppDelegate *' 分配给 'id<UIApplicationDelegate>'

在我的项目中它说Assigningto'AppDelegate*'fromincompatibletype'id'。这到底是什么?为什么会出现此警告?我已经在.m中声明了AppDelegate*appdev;并在viewDidLoad中{appdev=[[UIApplicationsharedApplication]delegate];我想隐藏这个警告。我应该怎么办?提前致谢。 最佳答案 因为你知道它们相等,所以添加一个强制转换让编译器知道AppDelegate*app=(AppDelegate*)[[UIApplicationsh

iphone - 从不兼容类型 'AppDelegate *' 分配给 'id<UIApplicationDelegate>'

在我的项目中它说Assigningto'AppDelegate*'fromincompatibletype'id'。这到底是什么?为什么会出现此警告?我已经在.m中声明了AppDelegate*appdev;并在viewDidLoad中{appdev=[[UIApplicationsharedApplication]delegate];我想隐藏这个警告。我应该怎么办?提前致谢。 最佳答案 因为你知道它们相等,所以添加一个强制转换让编译器知道AppDelegate*app=(AppDelegate*)[[UIApplicationsh

ios - 从 AppDelegate 呈现 UIAlertController

这个问题在这里已经有了答案:HowtopresentUIAlertControllerwhennotinaviewcontroller?(39个答案)关闭5年前。我正在尝试在我的iOS应用程序中显示来自AppDelegate的UIAlertController。以下是警报和当前方法。UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:cTitlemessage:cMessagepreferredStyle:UIAlertControllerStyleAlert];//Configurealertandac

ios - 从 AppDelegate 呈现 UIAlertController

这个问题在这里已经有了答案:HowtopresentUIAlertControllerwhennotinaviewcontroller?(39个答案)关闭5年前。我正在尝试在我的iOS应用程序中显示来自AppDelegate的UIAlertController。以下是警报和当前方法。UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:cTitlemessage:cMessagepreferredStyle:UIAlertControllerStyleAlert];//Configurealertandac

ios - 在 appdelegate 中设置初始 viewcontroller - swift

我想从appdelegate设置初始ViewController。我找到了一个非常好的答案,但是它在ObjectiveC中,我无法快速实现同样的事情。ProgrammaticallysettheinitialviewcontrollerusingStoryboards-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{self.window=[[UIWindowalloc]initWithFrame:UIScreen.mainSc

ios - 在 appdelegate 中设置初始 viewcontroller - swift

我想从appdelegate设置初始ViewController。我找到了一个非常好的答案,但是它在ObjectiveC中,我无法快速实现同样的事情。ProgrammaticallysettheinitialviewcontrollerusingStoryboards-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{self.window=[[UIWindowalloc]initWithFrame:UIScreen.mainSc

ios - 如何使用 Urban AirShip (Swift) 获取 appDelegate

整合UrbanAirship后,当我调用letappDelegate=UIApplication.sharedApplication().delegateas?AppDelegate我总是得到零。当我尝试获取UIApplication.sharedApplication().delegate类时,它告诉我,它现在是UAAppDelegateProxy。但是letappDelegate=UIApplication.sharedApplication().delegateas?UAAppDelegateProxy也返回零。如何获取我的appDelegate?编辑我发现,只有当UAConfi

ios - 如何使用 Urban AirShip (Swift) 获取 appDelegate

整合UrbanAirship后,当我调用letappDelegate=UIApplication.sharedApplication().delegateas?AppDelegate我总是得到零。当我尝试获取UIApplication.sharedApplication().delegate类时,它告诉我,它现在是UAAppDelegateProxy。但是letappDelegate=UIApplication.sharedApplication().delegateas?UAAppDelegateProxy也返回零。如何获取我的appDelegate?编辑我发现,只有当UAConfi